Change the PHP version and PHP settings per domain in Plesk

Change the PHP version for one domain in Plesk and edit its php.ini values, including memory_limit, upload_max_filesize and max_execution_time.

  • Beginner
  • Linux VPS
  • 4 min read

By RunRacks Team · Published

You can change the PHP version per domain in Plesk without affecting the other sites on the server. Plesk keeps a PHP handler and its own set of php.ini values for every domain, so you choose the version from a dropdown and edit limits such as memory_limit and upload_max_filesize on the same screen.

This guide uses Plesk Obsidian on Ubuntu 22.04/24.04 and AlmaLinux 8/9. The menu names are the same on Debian 12 and Rocky Linux.

Before you start

  • A RunRacks Linux VPS with Plesk installed, and your Plesk login (usually https://203.0.113.10:8443).
  • At least two PHP handlers installed. If the dropdown shows only one version, an administrator must add another one first under Tools & Settings > PHP Settings or Tools & Settings > Updates.
  • The domain you want to change, for example example.com.
  • The current PHP version and settings written down, so you can undo the change.

Open the PHP Settings page for a domain

  1. Log in to Plesk.
  2. Go to Websites & Domains.
  3. Find the domain and click PHP Settings in its row, or click the domain name and then PHP Settings.

The page shows the current handler at the top and the php.ini values below it. Everything here applies to this domain only. Subdomains have their own PHP Settings page, so shop.example.com can run a different version from the main site.

Change the PHP version for the domain

  1. On the PHP Settings page, open the PHP handler dropdown.
  2. Pick the version and serving mode you want, for example:
  • PHP 8.2.15 (FPM application served by Apache)
  • PHP 8.2.15 (FPM application served by nginx)
  • PHP 8.1.27 (FastCGI application served by Apache)
  1. Click Apply or OK.

The handler name tells you two things: the PHP version, and how requests reach PHP. FPM served by nginx is the usual choice when nginx is the front end. FPM served by Apache is the usual choice when Apache is the front end. FastCGI is the older mode; use it only when an extension or script needs it.

Edit PHP settings for the domain

Below the handler dropdown, Plesk lists the php.ini directives you can change per domain. Tick the checkbox next to a value, type the new value, and click Apply.

Common values to change

  • memory_limit — how much RAM one PHP request may use. Raise it for heavy WordPress or Magento pages. See Fix PHP "Allowed memory size exhausted" if you hit that fatal error.
  • upload_max_filesize — the largest single file a visitor can upload.
  • post_max_size — the largest total POST body. Keep it equal to or larger than upload_max_filesize, otherwise large uploads fail silently.
  • max_execution_time — seconds a script may run before PHP stops it. Raise it for long imports, not for normal pages.
  • max_input_vars — number of form fields PHP accepts. Raise it when a big form or menu editor drops fields.
  • opcache.enable — leave it on for production sites.

Additional configuration directives

The Additional configuration directives box at the bottom takes raw php.ini lines, one per line, for anything the list does not cover:

INI
date.timezone = Europe/London
opcache.memory_consumption = 256
realpath_cache_size = 4096k

Click Apply after editing. A typo here can take the site down, so add one line at a time and reload the site after each change.

Change the PHP version with the Plesk CLI (optional)

If

Was this guide helpful?

Still stuck?

Ask RunRacks AI for a quick answer, or open a ticket and our team will take a look at your server.

Control panels

CyberPanel: back up and restore a website

Create on-demand and scheduled website backups in CyberPanel, download the archives off the server, and restore a site from a backup when something breaks.

  • Intermediate
  • Linux VPS
  • 6 min read