Choosing the PHP Version and Settings for Your Project

Choosing the PHP Version and Settings for Your Project

Learn how to match the PHP version to what your project needs and adjust the most common PHP settings in Plesk. AI tools often write code for a recent PHP version, so a project can fail if your domain is set to an older one.

Steps

  1. Find out which PHP version your project needs. Open its composer.json file and look for the php line under require, or ask your AI tool
  2. Log in to Plesk via your Zeniar Portal
  3. Select Websites & Domains from the left-hand menu
  4. Click PHP under Dev Tools. If you have more than one domain, expand the domain you'd like to update first
  5. Next to PHP support, click the PHP version dropdown menu and select the version your project needs. Avoid any version marked as (Outdated)
  6. Leave the run PHP as option as it is
  7. Under Performance and security settings, adjust any limits your project needs. The settings are explained below
  8. Set display_errors to Off for a live website
  9. Click OK at the bottom of the page
  10. Visit your domain in a web browser to check that your project still loads

Important: Leave display_errors off on a live website. When it is on, error messages can show visitors file paths and other details about your project. Use the logs instead. See Viewing Domain Logs in Plesk

Your domain is now using the PHP version and settings your project needs.

Common Settings

  • memory_limit is the most memory one script can use. Raise it if your logs show an Allowed memory size exhausted error
  • max_execution_time is how many seconds a script can run. Raise it if long tasks, such as imports or calls to an AI service, stop part way
  • upload_max_filesize is the largest single file a visitor can upload through your project
  • post_max_size is the largest form submission allowed. Keep it the same as or larger than upload_max_filesize