Articles in this section

How to update PHP settings for Service plan or Add-on plan via command line interface in Plesk?

kb: how-to Plesk Obsidian for Linux ABT: Group B

Applicable to:

  • Plesk Obsidian for Linux

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:

  1. Login into server via SSH;
  2. 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 = 120

    Note: Mind syntax of the file, it should be: <parameter>=<value>. Use /var/www/vhosts/system/<domain name>/etc/php.ini as an example

  3. 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?

Reference for Command-line Utilities

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.