How To Install PHP 7 on CentOS 7


In this tutorial we will show you how to install and configuration of PHP 7 on your CentOS 7 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 CentOS 7 server.

Install PHP 7 on CentOS 7

Step 1. First you need to enable Webtatic and EPEL yum repositories on your system.

Step 2. Installing PHP 7 in CentOS 7.

Now, install PHP 7 using the following command:

Restart Apache after PHP installation:

Step 3. Install PHP 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. Verify Install PHP version.

Once it is completed, you can ensure that the latest stable release of PHP 7 is installed on your system by using the command:

To test PHP, create a test file named info.php with he content below. Save the file, then browse to it to see if PHP is working:

Congratulation’s! You have successfully installed PHP 7. Thanks for using this tutorial for installing PHP 7 on your CentOS 7 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!