How to setup / install PHP 5.6 on Ubuntu 14.04 LTS
PreviousNext
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/php
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
代碼: 選擇全部
sudo apt-get update
代碼: 選擇全部
sudo apt-get install php5.6
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.