Php tips & tricks

Upgrade to PHP 5.6 on Debian 7 “Wheezy”

Official Debian packages contain PHP 5.4 at the moment. If you need higher version, you need to use 3rd-party repositories such as dotdeb. Generally it is recommended to use the official packages. However, sometimes there are reasons to use third party repositories. And this is one of them. Process of upgrade to PHP 5.6 on Debian 7 “Wheezy” is pretty simple and take just a few minutes.

We are going to use Dotdeb repository. It contain a lot up-to-date packages for debian servers such as nginx, php, mysql, redis etc. Note that Dotdeb supports Debian 8.x “Jessie”, Debian 7.x “Wheezy” and Debian 6.x “Squeeze”.

Upgrade Steps

1. Add the main repository to your /etc/apt/sources.list file

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

2. If you want to install :

PHP 5.6 on Debian 7 “Wheezy” (without Zend thread safety):

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):

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

If you not sure about which version you need, you can check it by running phpinfo();
upgrade to PHP 5.6 on Debian

3. Fetch and install the GnuPG key

wget https://www.dotdeb.org/dotdeb.gpg
sudo apt-key add dotdeb.gpg

4. Run sudo apt-get update

5. Run sudo apt-get install php5

upgrade to PHP 5.6 on Debian DONE

ENJOY 🙂
upgrade to PHP 5.6 on Debian

8 thoughts on “Upgrade to PHP 5.6 on Debian 7 “Wheezy”

  1. Bullshit.
    I followed the instructions and it installed php 5.4 (which is the one I already had, obviously).
    Fucking waste of time.

  2. Its works, but there is a problem
    PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/lib/php5/20131226-zts/ncurses.so’ – /usr/lib/php5/20131226-zts/ncurses.so: cannot open shared object file: No such file or directory in Unknown on line 0

    To solve this problem, install Ncurses manually.
    # apt-get install php5-dev libncursesw5-dev php-pear
    # pecl install ncurses

    thank you, solved my problem.

Leave a Reply

Your email address will not be published. Required fields are marked *