• 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

Force update of domain php.ini files

gbotica

Regular Pleskian
Hello,

I am trying to increase the PHP memory limit for all Plesk hosted sites.

I've updated the 'memory_limit' setting in /etc/php.ini

Then I ran
Code:
/usr/local/psa/admin/sbin/httpdmng --reconfigure-all
/usr/local/psa/admin/sbin/httpdmng --reconfigure-server

Checking a phpinfo() page on hosted sites I see that this setting has not been effective.

Checking some /var/www/vhosts/system/domain.com/etc/php.ini also shows the old setting, and I can see that these files have not been updated.

I note that all these domain php.ini files have been modified earlier today, all at the same time, so presumably some process did regenerate them earlier. All these files hae the "DO NOT MODIFY ..." heading

I realise that I can go the the domain in Plesk GUI and save the PHP settings to force an update, but is there anyway to force the regeneration of all of these files via CLI?

Thanks very much for your assistance.
 
I see that I could use:

Code:
plesk bin site --update-php-settings example.com -settings my_file

But this would require creating a script to loop through each domain -- surely there's an easier way?

Is there some existing Plesk event that triggers these updates?
 
Hi gbotica,

the command "/usr/local/psa/admin/sbin/httpdmng --reconfigure-all" will force Plesk to generate as well the domain - specific PHP.ini - files located at "/var/www/vhosts/system/YOURDOMAIN_OR_SUBDOMAIN.COM/etc/php.ini" based on TWO settings:


If there is no specific domain/subdomain - setting made over the Plesk - Control - Panel the superordinate configuration is used.

Three examples which should make this clear, depending on your settings, you already made:

1. Example:
GLOBAL SUBSCRIPTIONS - PHP - SETTINGS ( priority 1 )
DOMAIN-PHP-SETTING EXAMPLEDOMAIN.COM ( priority 2 )
SUBDOMAIN_OF_EXAMPLEDOMAIN.COM ( priority 3 )

=> PHP - Settings of the SUBDOMAIN is used.
2. Example:
GLOBAL SUBSCRIPTIONS - PHP - SETTINGS ( priority 1 )
DOMAIN-PHP-SETTING EXAMPLEDOMAIN.COM ( priority 2 )
SUBDOMAIN_OF_EXAMPLEDOMAIN.COM ( none )

=> PHP - Settings of the EXAMPLDOMAIN.COM is used.

3. Example:
GLOBAL SUBSCRIPTIONS - PHP - SETTINGS ( priority 1 )
DOMAIN-PHP-SETTING EXAMPLEDOMAIN.COM ( none )
SUBDOMAIN_OF_EXAMPLEDOMAIN.COM ( none )

=> PHP - Settings of the SUBSCRIPTION - Plan is used.


The 2. based settings depends on your earlier made changes to a domain and/or subdomain. If you already made some additional changes, then these settings are stored in the database ( each domain/subdomain has it's own unique SITE-ID ! ) and the nextime you use the "--reconfigure-all" option will force Plesk to change the PHP on this behalf as well.
 
this is a dumb but quick way: if you have more than one php version running on your server, switch back and forth, and the local php.ini will be recompiled
 
I know this is an old thread, but its still not fixed bij plesk. The method i use is to replace it in all php.ini files and then restart the webserver:

Code:
find /var/www/vhosts/system/ -name 'php.ini' -type f | xargs perl -pi -e 's/$StringToFind/$StringToReplace/g'

regards
Jan
 
Back
Top