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
- Log in to Plesk.
- Go to Websites & Domains.
- Click the domain name you want to configure.
- Go to Hosting & DNS → PHP Settings.
- In the PHP version dropdown, select the desired PHP version (e.g., 8.1, 8.2, 8.3).
- 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.,
256Mor512M). Increase if your site shows memory errors. - max_execution_time: Maximum time a PHP script can run (e.g.,
300seconds). 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
- On the PHP Settings page, find the setting you want to change.
- Modify the value in the text field.
- Click Apply to save.
Setting a Default PHP Version for All New Domains
This option is available to administrators and resellers:
- Go to Tools & Settings → General Settings (or PHP Settings).
- Select the default PHP version.
- 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_filesizeandpost_max_sizeare increased. - Restart the website by toggling PHP handler off and on if changes do not take effect.