How To Install PHP 7 on Ubuntu 14.04

Install PHP 7 on Ubuntu 14.04

In this tutorial we will show you how to install of PHP 7 on your Ubuntu 14.04 server. For those of you who didn’t know, PHP (PHP: Hypertext Preprocessor) is a server-side scripting language designed for web development but also used as a general-purpose programming language. PHP code is interpreted by a web server with a PHP processor module, which generates the resulting web page: PHP commands can be embedded directly into an HTML source document rather than calling an external file to process data. PHP 7 comes with numerous new and improved features. One of the most noticeable is the new Zend Engine version. Also, other important improvements are the enhanced performance and significantly reduced memory usage. Thus, PHP 7 can be up to twice as fast as PHP 5.6.

This article assumes you have at least basic knowledge of linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple. I will show you through the step by step installation PHP 7 in Ubuntu 14.04 server.

Install PHP 7 on Ubuntu 14.04

Step 1. First of all make sure that all packages are up to date.

Step 2. Add the PPA (Personal Package Archive) repository for PHP 7 in your system.

Installing PHP 7 using the following command:

Now use the following command to check installed php version on your system:

And it should look like:

Step 3. Install PHP 7 modules.

If you like to search all the available PHP 7 modules you can use to command:

You may want to install some other PHP extensions required by your applications. Here is the list:

Step 4. Testing PHP 7 on Ubuntu 14.04

To test out PHP7, we need to create a PHP file a named info.php in /var/www/html/  using your favorite editor and insert the following lines of code:

Test out this  page in your browser with the following hyperlink with your IP address and you should see a page with the current PHP information such as version, compilation options, extensions etc:

Congratulation’s! You have successfully installed PHP 7. Thanks for using this tutorial for installing PHP 7 on your Ubuntu 14.04 system. For additional help or useful information, we recommend you to check the official PHP web site.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get a best deal!