• Hi, Pleskians! We are running a UX testing of our upcoming product intended for server management and monitoring.
    We would like to invite you to have a call with us and have some fun checking our prototype. The agenda is pretty simple - we bring new design and some scenarios that you need to walk through and succeed. We will be watching and taking insights for further development of the design.
    If you would like to participate, please use this link to book a meeting. We will sent the link to the clickable prototype at the meeting.
  • Our UX team believes in the in the power of direct feedback and would like to invite you to participate in interviews, tests, and surveys.
    To stay in the loop and never miss an opportunity to share your thoughts, please subscribe to our UX research program. If you were previously part of the Plesk UX research program, please re-subscribe to continue receiving our invitations.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.

Question PHP downgrade to all accounts - Plesk

Émerson Felinto

Regular Pleskian
How to apply a certain PHP version to all the sites of my Plesk server?
I have done this by service plan and it appears "Synchronizing ...". But when I access the client account (subscription) individually there still the same version continues. It seems Plesk only updates this version of PHP for new domains. How can I make this setting?

PS: I would like to downgrade from version 7.2 to 7.0 for all clients. If I uninstall PHP 7.2 in Plesk, will it automatically downgrade all sites to version 7.0?
 
a) in Plesk Panel go to "Tools & Settings" --> "PHP Settings" and click on the number on the right side of the current PHP version/handler these websites are configured now.
Copy & Paste this list of domains and save them into a text file on your server. (i.e. domains.txt)

b) run the following command on your server
Code:
for d in $(cat domains.txt); do plesk bin domain -u "$d" -php_handler_id plesk-php70-fpm; done

This would change the PHP handler for all these domains to v7.0 (provided by Plesk) running as FPM
 
Sure, most likely you need/want to use:
Code:
for d in $(cat domains.txt); do plesk bin domain -u "$d" -php_handler_id plesk-php70-fastcgi; done

But to make sure, you should check the available handler on the command line via "plesk bin php_handler --list"
Then use the correct name, listed under 'id' for the command above (instead of plesk-php70-fpm or plesk-php70-fastcgi)

You can also check the correct/favored PHP handler name in the Panel itself under "Tools & Settings" --> "PHP Settings"
Klick on the handler you want to use and then check the URL - the handler's name is the last part of it.
 
for d in `mysql -uadmin -p\`cat /etc/psa/.psa.shadow\` psa -Ns -e "select name from domains"`; do plesk bin domain -u "$d" -php_handler_id plesk-php70-fastcgi; done

no need for a text file :D
 
If you REALLY want to change ALL sites, then you can use the direct approach via database command, but i'd recommend to use
for d in `mysql -uadmin -p\`cat /etc/psa/.psa.shadow\` psa -Ns -e "select name from domains where htype='vrt_hst'"`; do plesk bin domain -u "$d" -php_handler_id plesk-php70-fastcgi; done
as this prevents unnecessary error messages for domains that do not have any php settings. (forwards, alias)

But I was under the impression that the OP "only" wanted to change the PHP 7.2 sites to 7.0, so my recommendation with the text file. (as I'm not able to construct the correct mysql query to select only such domains ;) )
 
Back
Top