Control panels

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.

BeginnerLinux server4 min read

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

Warning: Switching the PHP handler restarts the PHP-FPM pool for that domain. Visitors may see an error page for a few seconds. On a busy site, do this outside peak hours.

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.

Tip: The Websites & Domains list also has a PHP version dropdown directly on the domain row. Use it for a quick switch, then open PHP Settings when you need to change limits as well.

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.

Note: The handler list comes from the server, not from the domain. If the version you want is missing, install the matching plesk-phpXX package or add it through the Plesk Installer, then reload the page.

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.

Warning: Never set open_basedir or disable_functions to values you have not tested. A wrong value can lock the site out of its own files or break the Plesk file manager.

Change the PHP version with the Plesk CLI (optional)

If

Was this guide helpful?

Still stuck?

Ask MdmHost AI for a quick answer, or open a ticket and our team will take a look. We are here 24/7.