• 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

Question Make new PHP version default for all sites

Ekushey

New Pleskian
Hello, I had PHP 5.3 on Plesk 12.5, and I've installed PHP 5.6 in addition to that. Now is there a way to make the new PHP 5.6 the default version for all sites running on the server? Changing it manually for all sites will be time consuming.

Thanks!
 
Hi Ekushey,

pls. have a look at: "Home > Service Plans > Hosting Plans > YOUR-SERVICE-PLAN > (tab) PHP Settings"

... and consider to have another look at the official Plesk 12.5 documentation:

PHP Settings ( Plesk 12.5 online documentation for: Administrator's Guide )

Quoted from the documentation:

Inheriting PHP settings
Domains belonging to a subscription inherit the PHP settings defined on the subscription level. Subdomains inherit the PHP settings defined on the level of their parent domain. If you have the corresponding permissions on your subscription, you can change the PHP settings for every domain and subdomain independently of each other.

Customizing PHP Configuration ( Plesk 12.5 online documentation for: Reseller's Guide )

Quoted from the documentation:

69697.gif


Tip: Consider as well to use the SEARCH option at => https://docs.plesk.com/en-US/12.5/ which makes it quite easy to search for topics and their content at the official documentations! ;)
 
Thanks UFHH01, I found that after posting this and changed the PHP version on the hosting plans all the domains were under. However, it didn't work, so unable to find any other option I had to manually edit the PHP version from domain list page.
 
Hi Ekushey,

pls. don't forget to SYNC service-plans and/or subscriptions after your changes and make sure, that the depending subsriptions are not locked. Again, you might have a look at the Plesk documentation, if you experience issues here:


You might be interested as well, that Plesk offers a wide range of possible commands for the command line, which can be easier to use, than clicking through the Plesk Control Panel:

subscription: Subscriptions ( Plesk 12.5 online documentation for: Reference for Command-Line Utilities, Plesk for Linux )

Examples:

plesk bin subscription --unlock-subscription example.com && plesk bin subscription --sync-subscription example.com

plesk bin subscription -u example.com -php_handler_id YOUR-PHP-HANDLER-ID

The PHP-handler IDs can be displayed with the command:

plesk bin php_handler --list

or with the command:

plesk db "select name from ServiceNodeEnvironment where section='phphandlers';"
To get a list of your domains, you can as well use the command line: plesk db "SELECT name FROM domains;"

If you prefer a "one-command-line" for all domains on your server, you could use:

Code:
for i in `mysql -uadmin -p\`cat /etc/psa/.psa.shadow\` psa -Ns -e "select name from domains"`; do /usr/local/psa/bin/domain -u $i -php_handler_id YOUR-PHP-HANDLER-ID;done
 
Back
Top