活到老学到老  

记录遇到问题的点点滴滴。

Ubuntu 14.04 LTS 安装 PHP 5.6

8年前发布  · 2562 次阅读
  ubuntu  php5.6 

Ubuntu 14.04 LTS ships with PHP 5.5 by default, but if you want to use PHP 5.6, then it’s just 3 lines on the command line away. Please note that this tutorial is for installing on a fresh and untouched Ubuntu 14.04 LTS, not for updating an existing installation of PHP. This works perfectly on every tested Ubuntu 14.04 LTS.

1. Add PHP 5.6 package sources to your system:

sudo add-apt-repository ppa:ondrej/php5-5.6


and confirm with ENTER. If you get an error here, you need to install python-software-properties first (and then do the line above again):

sudo apt-get update
sudo apt-get install python-software-properties


2. Update

sudo apt-get update


3. Install PHP

sudo apt-get install php5


and confirm with “y” and ENTER. You’ll now already see “PHP 5.6.x” in the scrolling installation logs. To properly check the installed version of PHP do:

php5 -v


Voila! By the way, this extremely-easy-to-install PHP 5.6 package was created by Ondřej Surý, so consider donating him a beer or a coffee via his donation page.