Article ID: 125146, created on Apr 7, 2015, last review on Aug 10, 2016

  • Applies to:
  • Plesk 12.5 for Linux
  • Plesk 12.0 for Linux
  • Plesk 11.5 for Linux
  • Plesk 12.5 for Windows
  • Plesk 12.0 for Windows

PHP7 on Plesk 12.5 Out of the Box released! Read more in article #127701

Why do I need to run multiple PHP versions on the same server?

There are several reasons why you might need to run multiple versions of PHP on the same server. Maybe you have a PHP 5.2 application running on your server and you need to start working on another application based on a new framework such as Symfony2 or Lithium? Perhaps you have a client with a legacy site that runs PHP 5.2, or maybe you simply want to test some of the new functionality? Or maybe you want to move your hosting to a modern operating system, but keep some of your sites on an old PHP version that is available in your current operating system?

How can I use multiple PHP versions in Plesk 12.0 and in Plesk 12.5?

Now, with Plesk 12.0 and Plesk 12.5, you can install and use multiple PHP 5.x versions built by the Plesk team via Plesk panel, without any additional third-party repositories or building PHP from sources by yourself!

Plesk PHP packages do not conflict with or replace other PHP packages, so you can continue using your current PHP builds or third-party PHP packages.

PHP packages from the Plesk team are available on:

Plesk 12: CentOS 6, CentOS 7, and Ubuntu 14

Plesk 12.5: Ubuntu 12/14, Debian 7/8 and CentOS/RHEL 6, 7 operating systems.

Step 1. Install the necessary PHP versions packaged by the Plesk team

  • Install via GUI:

    Just go to the Plesk Installer interface and choose the PHP versions you need (Add/Remove Components > Web hosting features > Different PHP interpreters versions).

  • Install via CLI:

    #plesk sbin autoinstaller --select-product-id plesk --select-release-current  --install-component php5.6

Note: The "PHP 5 support (from OS vendor)" component cannot be removed even if it is no longer needed.

Note: The PHP-FPM handler is not a part of Plesk PHP packages at the moment. This will change starting from Plesk 12.5, so you will be able to select the necessary PHP-FPM versions as well.

Step 2. Select the required PHP versions in your service plans and website settings.

After installation, new PHP versions will be available for selection in service plans and website hosting settings.

Switching Websites to PHP Packaged by the Plesk Team

PHP packages from the Plesk team do not replace already installed PHP versions and do not update any existing service plans and websites. If you already use PHP packages from third-party repositories and want to move your sites to PHP packaged by the Plesk team, you need to do it manually in Plesk UI or via the Plesk command-line interface.

An easy way to do it is as follows. For example, let’s switch all websites from "PHP 5.3 fastcgi" from the CentOS 6 repository to "PHP 5.4 fastcgi" packaged by the Plesk team.

  • Check that both new and old PHP handlers are registered in Plesk by executing the command

    /usr/local/psa/bin/php_handler --list

See the entries in the "display name" column.

  • Switch all websites to the new PHP handler (as indicated by entries in the "id" column):

    /usr/local/psa/bin/php_handler --replace -old-id fastcgi -new-id plesk-php54-fastcgi

If anything goes wrong with the switch, use the attached helper utility to check the current state and to switch handlers. You need to run it as the user root.

The following command shows all domains and handlers currently used:

#php php_management_tool list 

The next command switches all domains that use a specified PHP handler from one handler (specified with the --from option) to another (specified with the --to option):

#php php_management_tool move --from=fastcgi-54 --to=plesk-php54-fastcgi

The command below switches the specified domains to the PHP handler that is specified with the --to option:

#php php_management_tool move --to=plesk-php56-cgi,

Technical Details

PHP packages from the Plesk team do not conflict with packages from other third-party repositories. The package names have the "plesk-php" prefix. You can use one of the following commands to check PHP packages from the Plesk team that are currently installed on the server.

On RedHat-based operating systems:

rpm -qa|grep "plesk-php" 

on Ubuntu/Debian:

dpkg -l|grep "plesk-php"  

All files are installed into /opt/plesk/php/<version> directory.

The php.ini file is located in /opt/plesk/php/<version>/etc.

To check the PHP handlers currently registered in Plesk, you can use this command:

/usr/local/psa/bin/php_handler --list

How to install "devel" packages

For example, if you want to install "devel" packages for Plesk PHP, you need to install the plesk-phpXX-devel package for the corresponded PHP version using a system package manager tool (yum or apt):

# yum install plesk-php56-devel


# apt-get install plesk-php56-devel

Adding custom PHP modules in Plesk

To add a module, you first need to download and install the necessary packages, then build the module, and finally enable it for the corresponding PHP version. The steps for the build procedure deviate very little from the standard PHP instructions found here – just pay attention to the custom paths you will need to use.

The example below illustrates the concept by adding the memcached module for PHP 5.6. The commands in the example are for CentOS 7, but you can make use of this functionality on different OSes as well. You may need to alter the package names slightly, but the underlying principle remains the same.

Download and install the necessary packages:

# yum search plesk-php devel
# yum install make plesk-php56-devel gcc glibc-devel libmemcached-devel zlib-devel

Then build the module:

# /opt/plesk/php/5.6/bin/pecl install memcached

(when prompted for the libmemcached directory, leave it blank and press the Enter key)

Register it for the corresponding PHP version:

# echo "" > /opt/plesk/php/5.6/etc/php.d/memcached.ini

And finally, check that the module is enabled:

# /opt/plesk/php/5.6/bin/php -i | grep "memcached support"
memcached support => enabled

Possible Issues and Limitations

  • Plesk Mirror Tool. If you are using a Plesk repository mirror, you should update the tool by obtaining it from The current version is 1.4.

  • PHP-FPM and PHP Apache module are not included in PHP packages from the Plesk team.

  • PHP packages from the Plesk team are not available on old operating systems. Currently, PHP packages from the Plesk team are available on CentOS 6, CentOS 7, and Ubuntu-14. Starting from Plesk 12.1, we will extend this list with Ubuntu 12 and Debian operating systems.

Please post your feedback regarding the Multiple PHP feature at this Plesk forum thread


php_management_tool, utility to manage php handlers from CLI per domain.

Plesk Mirror Tool, utility to manage Plesk repository mirror.

Plesk forum thread for open discussion

PHP Handlers, Administrator guide

Search Words



php version not available

PHP Notice: Trying to get property of non-object; File:

Different PHP Interpreter failed

Multiple PHP Versions


plesk info

php 5.3

plesk information

Cannot changed php version


upgrade version php


mulitple php support for red hat

multiple php versions error

php version not installed

php and mysql update

can't get php to upgrade

Missing PHP version componant in Plesk

plesk issues

Cannot install PHP 5.3.10

29d1e90fd304f01e6420fbe60f66f838 56797cefb1efc9130f7c48a7d1db0f0c a914db3fdc7a53ddcfd1b2db8f5a1b9c 2a5151f57629129e26ff206d171fbb5f e335d9adf7edffca6a8af8039031a4c7 742559b1631652fadd74764ae8be475e 0a53c5a9ca65a74d37ef5c5eaeb55d7f 8b661cab116c79dbe6c4ac5bbdf1c8cb 85a92ca67f2200d36506862eaa6ed6b8 a766cea0c28e23e978fa78ef81918ab8 01bc4c8cf5b7f01f815a7ada004154a2 ed7be2b984f9c27de1d2dc349dc19c6d

Email subscription for changes to this article
Save as PDF