Plesk lets you change the PHP version and configuration for each domain individually. This is useful when your website or application requires a specific PHP version, or when you need to adjust settings like memory limit, upload size, or execution time. This guide covers both tasks.

Changing the PHP Version for a Domain

  1. Log in to Plesk.
  2. Go to Websites & Domains.
  3. Click the domain name you want to configure.
  4. Go to Hosting & DNSPHP Settings.
  5. In the PHP version dropdown, select the desired PHP version (e.g., 8.1, 8.2, 8.3).
  6. Click Apply or OK.

Common PHP Settings to Adjust

On the same PHP Settings page, you can modify configuration directives:

  • memory_limit: Maximum memory a PHP script can use (e.g., 256M or 512M). Increase if your site shows memory errors.
  • max_execution_time: Maximum time a PHP script can run (e.g., 300 seconds). Increase for slow operations like large file imports.
  • upload_max_filesize: Maximum file upload size (e.g., 64M). Increase if you need to upload large files.
  • post_max_size: Maximum size of POST data (should be larger than upload_max_filesize).
  • max_input_vars: Maximum number of input variables (increase if forms with many fields are being truncated).
  • display_errors: Set to Off for production sites to avoid exposing sensitive information.
  • opcache.enable: Set to On for better PHP performance.
  • disable_functions: List of disabled PHP functions. Leave empty unless your provider has specific requirements.

Changing PHP Settings

  1. On the PHP Settings page, find the setting you want to change.
  2. Modify the value in the text field.
  3. Click Apply to save.

Setting a Default PHP Version for All New Domains

This option is available to administrators and resellers:

  1. Go to Tools & SettingsGeneral Settings (or PHP Settings).
  2. Select the default PHP version.
  3. Click OK.

Important Notes

  • PHP version changes take effect immediately. If your site shows errors after changing the version, switch back to the previous version.
  • Some applications (especially older ones) may not be compatible with the latest PHP version. Check compatibility before upgrading.
  • The available PHP versions depend on what your hosting provider has installed on the server.
  • PHP settings changes only affect the specific domain, not all domains on the server.

Troubleshooting

Website shows 500 error after changing PHP version:

  • Switch back to the previous PHP version immediately.
  • Check your application compatibility with the new PHP version.

Cannot find the PHP version dropdown:

  • Your hosting provider may restrict PHP version changes. Contact support.

Upload size is still too small after changing settings:

  • Ensure both upload_max_filesize and post_max_size are increased.
  • Restart the website by toggling PHP handler off and on if changes do not take effect.
Was this answer helpful? 0 Users Found This Useful (0 Votes)