• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

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