ISPConfig 3.1 – Additional PHP Versions Tutorial

Fast tutorial how to install into ISPConfig 3.1 Additional PHP Versions without compiling from sources.

Note: There is official tutorial on howtoforge.com but from my point of view is so complicated and each time you need to compile new PHP version or additional PHP extensions. That’s the reason why repository is the best choice and super easy to setup in this tutorial instead of compiling PHP from sources.

This tutorial is suitable for ISPConfig 3.1 running on Ubuntu 16.04 with PHP-FPM. But in result it can be done on any Debian/Ubuntu version. I will install additional PHP 5.6 version for ISPConfig from repository.

  • First we need to add PHP repository maintained by Ondřej Surý
aptitude install python-software-properties
add-apt-repository ppa:ondrej/php
apt-get update
aptitude-update
  • After we will install PHP5.6 and most common modules
aptitude install php5.6-cli php5.6-fpm php5.6-gd php5.6-mysql php5.6-imap php5.6-mcrypt php5.6-curl php5.6-intl php5.6-pspell php5.6-recode php5.6-sqlite3 php5.6-tidy php5.6-xmlrpc php5.6-xsl php5.6-zip php5.6-mbstring
  • Now we will add Additional PHP version 5.6
    • Login as Admin into ISPConfig and navigate to System > Additional PHP Versions > Add new PHP version
    • Choose correct server where you’ve installed PHP5.6 and set PHP Name like: PHP5.6
    • Switch to PHP-FPM Settings
      • Path to the PHP-FPM init script: /etc/init.d/php5.6-fpm
      • Path to the php.ini directory: /etc/php/5.6/fpm
      • Path to the PHP-FPM pool directory: /etc/php/5.6/fpm/pool.d
      • Save
  • Now you can choose any web page and select your PHP5.6 version.

5 thoughts on “ISPConfig 3.1 – Additional PHP Versions Tutorial

  1. Thanks a bunch for writing this. Spent hours trying to apply additional php versions following other official and non official ISPconfig guides without success. This made it sooo easy! Have now got 5.6, 7.0, 7.1, 7.2 & 7.3 working perfectly. All setup in just a few minutes! My system is Ubuntu 16.04.1 LTS with ISPConfig 3.1.12 running on EC2 AWS.

  2. Hi MyKE , thanks for the post.
    Even if it looks very easy, I cannot make my ISPConfig use different php versions on different sites.
    I have both php7.0 and php5.6 installed, and, in the system, which is a debian 9.3, the default php is 5.6:

    ls -lh /etc/alternatives/php
    lrwxrwxrwx 1 root root 15 Feb 4 16:15 /etc/alternatives/php -> /usr/bin/php5.6

    but nonetheless sites use the latest php available (7.0)

    I’ve added the php-fpm5.6 as you described, checking that all the files and path exist, but with little luck.

    Any suggestion on how to fix the situation?

    Thank you
    davide

    • Hi davide,

      As you mentioned you use Debian 9, did you use correct repository for Debian (DPA repository)? You need to install php-fpm version.

      Maybe debian packages gives binary and configuration files to different paths than ubuntu (/etc/init.d/phpX.Y-fpm;/etc/php/X.Y/fpm).

      MyKE

  3. Hi again
    I still cannot use different php versions. No matter what I set for each website, only default php version is taken into consideration by the different websites.

    The files
    /etc/init.d/php5.6-fpm
    /etc/php/5.6/fpm
    etc/php/5.6/fpm/pool.d

    do exist.
    I tried different versions (5.6 7.0 7.2) but none of them worked.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.