Article ID: 118378, created on Nov 1, 2013, last review on Jun 17, 2016

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


On Linux systems, you can install any PHP version you need and then make it available in Plesk by registering it with the php_handler command line utility.


A PHP version is required that is not provided in Plesk.


For CloudLinux:

If you are a CloudLinux user, you can use the CloudLinux PHP selector feature:

For Plesk 12 and Pleks 12.5:

Since Plesk 12.0.18 MU#41, you can install and use multiple PHP 5.x versions built by the Plesk team via the Plesk panel. For more details, see KB article 125146: Multiple PHP Versions in Plesk 12 and higher Out of the Box

PHP packages for Plesk 12:

  • CentOS 6
  • CentOS 7
  • Ubuntu 12

PHP packages for Plesk 12.5:

  • CentOS 6
  • CentOS 7
  • RHEL 6
  • RHEL 7
  • Debian 7
  • Debian 8
  • Ubuntu 12
  • Ubuntu 14

For Plesk 11.5 :

Step 1. Install the required PHP version on your Plesk server

For installation guidelines, refer to the official PHP documentation available at

    Note: It is recommended to build PHP in another (non-production) environment with the same operating system version as on the target server. This helps you avoid installing a large number of unnecessary packages on your production system. In the example below, PHP 5.6.3 is used. However you can use the instructions to install any PHP version.

In brief, the installation includes the following main steps:

  1. SSH to the computer which is used for the PHP compilation as root.

  2. Download the PHP source:

    # cd /usr/local/src/
    # wget --output-document="php-5.6.3.tar.bz2"
  3. Make sure that the PHP distribution package was downloaded successfully:

    # ls -la
    total 13156
    drwxr-xr-x  2 root root     4096 Nov 29 08:39 .
    drwxr-xr-x 15 root root     4096 Nov 29 08:39 ..
    -rw-r--r--  1 root root 13461539 Nov 14 06:41 php-5.6.3.tar.bz2 
  4. Unpack it from the archive:

    # tar xjvf php-5.6.3.tar.bz2
    # mv php-5.6.3 php563
  5. Install the necessary libraries:

    On CentOS 6.x:

    # yum install libxml2-devel openssl-devel bzip2-devel curl-devel libjpeg-devel libpng-devel freetype-devel gmp-devel mysql-devel ncurses-devel unixODBC-devel net-snmp-devel mhash-devel libc-client-devel libicu-devel gcc postgresql-devel aspell-devel libxslt-devel gcc-c++ openldap-devel

    On Debian 6 Squeeze:

    #apt-get install libxml2-dev libbz2-dev libcurl4-openssl-dev libjpeg-dev libpng-dev libfreetype6-dev libgmp3-dev libc-client-dev libicu-dev libsasl2-dev unixodbc-dev libpspell-dev libsnmp-dev libxslt-dev
  6. Install additional libraries

    This depends on the system that is used for the PHP compilation. It will become clear on the configure step.

  7. Configure

    # cd /usr/local/src/php563
    # ./configure '--with-libdir=lib64' '--cache-file=../config.cache' '--prefix=/usr/local/php563-cgi' '--with-config-file-path=/usr/local/php563-cgi/etc' '--disable-debug' '--with-pic' '--disable-rpath' '--with-bz2' '--with-curl' '--with-freetype-dir=/usr/local/php563-cgi' '--with-png-dir=/usr/local/php563-cgi' '--enable-gd-native-ttf' '--without-gdbm' '--with-gettext' '--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr/local/php563-cgi' '--with-openssl' '--with-pspell' '--with-pcre-regex' '--with-zlib' '--enable-exif' '--enable-ftp' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-sysvmsg' '--enable-wddx' '--with-kerberos' '--with-unixODBC=/usr' '--enable-shmop' '--enable-calendar' '--without-sqlite3' '--with-libxml-dir=/usr/local/php563-cgi' '--enable-pcntl' '--with-imap' '--with-imap-ssl' '--enable-mbstring' '--enable-mbregex' '--with-gd' '--enable-bcmath' '--with-xmlrpc' '--with-ldap' '--with-ldap-sasl' '--with-mysql=/usr' '--with-mysqli' '--with-snmp' '--enable-soap' '--with-xsl' '--enable-xmlreader' '--enable-xmlwriter' '--enable-pdo' '--with-pdo-mysql' '--with-pdo-pgsql' '--with-pear=/usr/local/php563-cgi/pear' '--enable-intl' '--without-pdo-sqlite' '--with-config-file-scan-dir=/usr/local/php563-cgi/php.d' '--enable-cgi'

    Note: It is required to use a switch prefix for new PHP to be installed inside a single directory. As an example, the prefix here is /usr/local/php563-cgi/

    Choosing a prefix is very important because it prevents the new PHP installation from interfering with the other PHP installations available on the server.

  8. After the configuration successfully finishes, compile PHP

    # cd /usr/local/src/php563
    # make
  9. [Skip this step if PHP has been built in a production environment] Archive the compiled PHP and transfer it to your Plesk server.

    Please note that the full path to the directory containing the compiled PHP on the Plesk server must be the same as on the source server:

    # cd /usr/local/src/
    # tar cjvf php563.tar.bz2 php563
    # scp php563.tar.bz2 root@<your_plesk_server_ip>:/usr/local/src
  10. Connect by SSH to your Plesk server and unpack the archive file with the compiled PHP:

    # cd /usr/local/src
    # tar xjvf php563.tar.bz2
  11. Go to your Plesk server and install PHP:

    # cd /usr/local/src/php563
    # make install
  12. Set up php.ini:

    # cp php.ini-development /usr/local/php563-cgi/etc/php.ini

    You can edit the php.ini file to set PHP options. If you prefer having 'php.ini' in another location, run the configure utility with the option --with-config-file-path=/some/path in configure step.

  13. Restore SELinux contexts:

    # restorecon -R /usr/local/php563-cgi

Step 2. Register the new PHP version in Plesk

/usr/local/psa/bin/php_handler --add -displayname <NN> -path <path to php cgi> -clipath <path to php-cli> -phpini <path to php.ini> -type <php handler> -id <NN-custom>


  • -displayname <NN> is the PHP version name that will be shown in the Plesk interface. We recommend you to include the version number in the displayname. For example, you could name the version "5.6.3-custom".

  • -path <path/to/php/cgi> is the location of the PHP CGI binary file. You can find this in the output of the "make install"command in the "Installing PHP CGI binary" line. For example, if you see the following in the "Installing PHP CGI binary" line: /usr/local/php563-cgi/bin/, the location you need to specify is /usr/local/php563-cgi/bin/php-cgi. Learn more at the Official PHP web Site.

  • -clipath <path to php-cli> is the location of the php file, for example, /usr/local/php563-cgi/bin/php

  • -phpini <path/to/php.ini> is the location of the php.ini file, for example, /usr/local/php563-cgi/etc/php.ini .

  • -type <php handler> is the type of PHP handler associated with this version. It can be either 'cgi' or 'fastcgi'.

  • -id <NN-custom> is the identifier you will use when referring to this PHP version (for example, when adjusting or removing it).

For example:

# /usr/local/psa/bin/php_handler --add -displayname php-5.6.3 -path /usr/local/php563-cgi/bin/php-cgi -clipath /usr/local/php563-cgi/bin/php -phpini /usr/local/php563-cgi/etc/php.ini -type fastcgi -id 2

After you register the PHP version in Plesk, it will be available for selection in the Websites > Hosting Settings of a particular website. See the picture below:

Listing Registered PHP Handlers:

To see a list of registered PHP handlers on a Plesk server, run this command:

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

Search Words

unable to use diffent php version

PHP version

enable multiple PHP Versions in Plesk

multiple php in Plesk


additional php version

upgrade php

How to select different php versions

add php handler

Plesk Upgrade PHP Version

choose php version

php 5.3.10

configure php

compile php

enable multiple php versions

01bc4c8cf5b7f01f815a7ada004154a2 56797cefb1efc9130f7c48a7d1db0f0c a914db3fdc7a53ddcfd1b2db8f5a1b9c 29d1e90fd304f01e6420fbe60f66f838 0a53c5a9ca65a74d37ef5c5eaeb55d7f 2a5151f57629129e26ff206d171fbb5f e335d9adf7edffca6a8af8039031a4c7 742559b1631652fadd74764ae8be475e

Email subscription for changes to this article
Save as PDF