• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Does custom php.ini require dedicated IP?

BrittT

New Pleskian
I am trying to use custom php.ini configurations for some of the subscriptions running FastCGI, but it is not picking up the new values. I have tried to modify values, specifically session.save_path, using a file in ../conf/php.ini and have also attempted to use custom values in the Control Panel for the specific subscription. I have combed through most of the forum posts on this topic that I can find but haven't found any real solutions to getting it working consistently. One post seems to indicate it will only work for subscriptions with a dedicated IP.

I am running PP 10.4.4 Update #47 on RHEL 5.6 with PHP 5.3. Any help would be greatly appreciated!
 
I have read those and similar KBs and the Plesk 10.4 documentation multiple times and unless I am missing something everything is set up correctly for the Webspace. I have PHP Support set to FastCGI Application and I have the following in conf/php.ini...

------------
PHP:
open_basedir = "/var/www/vhosts/<domain>/httpdocs:/var/www/vhosts/<domain>/data:/var/www/vhosts/<domain>/site_temp:/var/www/vhosts/<domain>/site_uploads:/var/www/vhosts/<domain>/site_sessions"
upload_tmp_dir = "/var/www/vhosts/<domain>/site_temp"

[Session]
session.save_path = "/var/www/vhosts/<domain>/site_sessions"
------------

I see that these values are being picked up by Plesk and put in etc/php.ini but they are not being used by the running FastCGI PHP processes as I only see default values in a phpinfo() page.
 
I would think that with the addition of the custom configuration the php-cgi process would now run with the -c option and include the path to the new php.ini file, but the processes are not running with any additional options.


As a sidenote if I create a new .ini file in /etc/php.d using the [HOST=] option and the specific directives they do correctly override the default php.ini for this specific domain. This option is new to PHP 5.3 and also only available for CGI/FastCGI... http://us3.php.net/manual/en/ini.sections.php
 
Anyone have additional thoughts?

It seems fairly straightforward but Plesk is not using the new configurations correctly. I really need to get this working!
 
Hi Britt,

I can only tell that php.ini definitely does not depend on dedicated IP. As long as you edit settings through Plesk UI, the values should get into the right file - php.ini for FastCGI and apache config for mod_php.
With given details it is almost impossible to compare your case with proper configuration. The only similar case I have ever seen before was quite simple - sites were running in mod_php and site owner forgot of this detail.
 
The webspace that I'm using to test this configuration is definitely mod_fcgid because I have checked, double, and triple checked that it was configured that way. That would definitely be an irritating discovery at this point. As I stated before, if I create a custom php.ini file in /etc/php.d with a [HOST=] entry and the specific directives I want to override the php-cgi running for this webspace picks up the changes. Howerver, the values that are present in the webspaces etc/php.ini are not being picked up.

I am wondering if because I upgraded from Plesk 10.2 to 10.4.4 rather than doing a fresh install that something is missing or misconfigured within Plesk.

Would it be possible for someone to detail how Plesk picks up that their are overridden value and implements them via php-cgi? I assume after seeing changes it would start executing the php-cgi process with the -c option and include the path to the new php.ini file. Is this correct?
 
OK, I figured out the problem. I have a custom template for domainVirtualHost and the upgrade process didn't modify that file. So all the new configuration settings for PP_CUSTOM_PHP_INI were not in the httpd.include configurations for the webspaces. I no longer require the changes configured in this custom templates so I removed them and reconfigured my domain(s). My php-cgi process is now running with a "-c /var/www/vhosts/<domain.tld>/etc/php.ini"
 
Back
Top