How to install PHP 7.0 on Ubuntu 14.04 LTS
You want to install PHP 7 within 60 seconds ? No problem, but first make sure you have a fresh installation of Ubuntu 14.04 (LTS) here, sudo rights and no existing version of PHP on this system. Please note that this is only for Ubuntu, not for other operating systems! It might work too on Debian.
1. Add package source to your system:
It always takes some time until new versions of PHP (and other languages) are available via regular packages on Ubuntu systems, so this awesome guy called Ondřej Surý offers pre-packaged builds of new PHP versions right after they have been released. This is awesome, and we should be thankful for these excellent packages, so if this works for you, consider spending him a beer or a coffee via his donation page. However, please keep in mind that this is a superfresh version and an unofficial package!
On the command line, simply type
sudo add-apt-repository ppa:ondrej/php
and confirm the upcoming dialog 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 Ubuntu package sources
Then download and update the Ubuntu package lists via
sudo apt-get update
3. Install PHP 7.0.x
And now install PHP via
sudo apt-get install php
Confirm with “y” and ENTER. Done! Make sure you are typing “php”, not “php5”, this might be confusing as in the last 10(?) years it has always been php5. To check if everything has been installed properly, do
The result should be something like this:
Boom! Have fun with the awesome new version!