Question
How to change/customize PHP settings for Service plan or Add-on plan via CLI?
Answer
It is possible to configure the following PHP settings parameters:
Performance settings
- memory_limit
- max_execution_time
- max_input_time
- post_max_size
- upload_max_filesize
Common settings
- include_path
- session.save_path
- mail.force_extra_parameters
- open_basedir
- error_reporting
- display_errors
- log_errors
- allow_url_fopen
- file_uploads
- short_open_tag
To apply settings for Service plan/Add-on plan proceed with the following:
-
Login into server via SSH;
-
Create file named
custom_settings
with PHP settings you would like to set. For example:# vi custom_settings
max_execution_time = 120
max_input_time = 120Note: Mind syntax of the file, it should be:
<parameter>=<value>
. Use/var/www/vhosts/system/<domain name>/etc/php.ini
as an example -
Apply changes:
For Service plan:
# plesk bin service_plan --update-php-settings '<put service plan name>' -settings custom_settings
For Add-on plan:
# plesk bin service_plan_addon --update-php-settings '<put add-on name>' -settings custom_settings
Additional info
How to change/customize PHP settings for Service plan via Plesk UI?