- Plesk Onyx 17.5 for Linux
How to change PHP parameters
for all subscriptions on the server?
What is the best method to update the php value for all account hosted on server:
post_max_size = 32M,
upload_max_filesize = 20M?
1. To change the value for all domains assigned to a certain PHP version, do the following:
1.1 Connect to the server using SSH.
1.2 Go to Plesk > Tools & Settings > PHP Settings and click on any handler, e.g. 5.4.16 by OS vendor CGI application
1.3Go to php.ini tab
1.4 Find the directives post_max_size and upload_max_filesize and change their values to the needed ones (32M and 20M corresponding)
1.5 Click on OK
1.6 Wait until Applying global PHP settings to domains... will be changed to Global PHP settings were successfully applied to domains. New settings will be applied for all 5.4 by OS handlers (5.4.16 by OS vendor FastCGI application, 5.4.16 by OS vendor FPM application, etc.).
Alternatively, use the following solution:
2. For subscriptions that:
- already existing subscriptions which are assigned to a service plan with the disabled permission Hosting performance settings management (service plan permissions can be checked at Service Plans > service_plan_name > Permissions ).
- are going to be created in the future.
2.1 In Plesk, go to Service Plans > service_plan_name > PHP Settings
parameters to desired values
2.3 click Update & Sync.
3. For subscriptions that:
- are assigned to a certain service plan with already enabled permission Hosting performance settings management.
3.1 Connect to the server using SSH.
3.2 Create a text file with the following contents:
# cat params
post_max_size = 32M
upload_max_filesize = 20M
3.3 Execute the following command to retrieve the list of all domains with hosting from the Plesk database, set PHP parameters which are specified in the file
plesk bin site
CLI utility and print
example.com - success
after each domain is processed:
# plesk db -sN -e"select name from domains where htype='vrt_hst'" | while read i; do plesk bin site --update-php-settings $i -settings params && echo "$i - success"; done