How to upgrade PHP version on Debian?

Created:

2016-11-16 12:51:27 UTC

Modified:

2017-05-22 14:58:17 UTC

14

Was this article helpful?


Have more questions?

Submit a request

How to upgrade PHP version on Debian?

Applicable to:

  • Plesk 11.5 for Linux
  • Plesk 12.0 for Windows
  • Plesk 12.0 for Linux

Question

How to upgrade PHP version installed on Debian to 5.4/5.5/5.6?

Answer

Please note: Plesk officially supports packages that are shipped with it, system packages and packages from official system repositories.

If your system does not have newer versions of PHP packages in official repositories - it should be compiled manually or installed from 3rd-party repositories.

Such PHP upgrade is purely administrative task and should be done by your local administrator. This operation is Out of Odin support scope.

Here is only an example how PHP can be updated using 3rd-party repository on Debian:

  1. Add the main repository to your sources.list

    Depending on your distribution (Jessie, Wheezy or Squeeze), add these two lines to your /etc/apt/sources.list file (you can also choose a mirror near you) :

    deb http://packages.dotdeb.org jessie all
    deb-src http://packages.dotdeb.org jessie all

    or

    deb http://packages.dotdeb.org wheezy all
    deb-src http://packages.dotdeb.org wheezy all

    or

    deb http://packages.dotdeb.org squeeze all
    deb-src http://packages.dotdeb.org squeeze all
  2. Options

    If you want to install :
    PHP 5.6 on Debian 7 “Wheezy” (without Zend thread safety), add these two lines too :

    deb http://packages.dotdeb.org wheezy-php56 all
    deb-src http://packages.dotdeb.org wheezy-php56 all

    PHP 5.6 on Debian 7 “Wheezy” (with Zend thread safety), add these two lines instead :

    deb http://packages.dotdeb.org wheezy-php56-zts all
    deb-src http://packages.dotdeb.org wheezy-php56-zts all

    PHP 5.5 on Debian 7 “Wheezy”, add these two lines too :

    deb http://packages.dotdeb.org wheezy-php55 all
    deb-src http://packages.dotdeb.org wheezy-php55 all

    PHP 5.4 on Debian 6 “Squeeze”, add these two lines too :

    deb http://packages.dotdeb.org squeeze-php54 all
    deb-src http://packages.dotdeb.org squeeze-php54 all
  3. Fetch and install the GnuPG key

    wget http://www.dotdeb.org/dotdeb.gpg
    sudo apt-key add dotdeb.gpg
  4. Install

    apt-get update  
    apt-get install php5

Note : Not listed PHP versions should be complied manually. In case of any issues with PHP compiling or installation from 3rd-party repositories please refer to PHP documentation or contact your local administrator for further support.

Have more questions? Submit a request
Please sign in to leave a comment.