Applicable to:
- Plesk for Windows
- Plesk for Linux
Question
How to change a default PHP version/handler assigned for newly created service plans?
Answer
Currently, there is no such functionality in Plesk.
However, the corresponding request already exists on Plesk User Voice. Leave your vote there - top-ranked suggestions are likely to be included in the next versions of Plesk.
As a workaround create 2 event handlers (for service plans created by administrator and by resellers) which will setup needed PHP version and handler:
-
Go to Tools & Settings > Event Manager and click Add Event Handler:
-
Select the event Service plan of administrator created and paste the command below into the Command field:
CONFIG_TEXT: /usr/local/psa/bin/service_plan -u "$(plesk db -Ne'select name from Templates ORDER BY id DESC LIMIT 1;')" -owner $(plesk db -Ne'select login from clients where id = (select owner_id from Templates ORDER BY id DESC LIMIT 1);') -php_handler_id plesk-php71-fpm
Instead of plesk-php71-fpm one of the IDs from the PHP handlers list can be used; see them by running the following command in SSH/Command Prompt:
# plesk bin php_handler --list
-
Create an additional event handler for Service plan of reseller created and paste the command below to the Command field:
CONFIG_TEXT: /usr/local/psa/bin/service_plan -u "$(plesk db -Ne'select name from Templates ORDER BY id DESC LIMIT 1;')" -owner "$(plesk db -Ne'select login from clients where id = (select owner_id from Templates ORDER BY id DESC LIMIT 1);')" -php_handler_id plesk-php71-fpm
Other IDs (see the command from step 2) can be used instead of plesk-php71-fpm.
Comments
0 comments
Please sign in to leave a comment.