Install PHP 5.6 On Debian Wheezy

I have several Linux host installed Debian 7.0(Wheezy), default PHP version is 5.4, but Laravel has required 5.6. So I have to upgrade PHP to 5.6.

Here is the things:

  • Add dotdeb repo to APT source list.
echo "deb wheezy-php56 all" >> /etc/apt/sources.list.d/dotdeb.list
echo "deb-src wheezy-php56 all" >> /etc/apt/sources.list.d/dotdeb.list
  • Update apt-get database apt-get update
  • Upgrade PHP apt-get upgrade php5-cli php5-fpm
  • Restart php5-fpm: /etc/init.d/php5-fpm restart

Enjoy your life.;-)