CentOS System with PHP version is very low, if we need to use a high version of PHP, you can not compile the installation, directly with the Yum installation will be very time-saving.
Brief introduction
PHP (Hyper-text preprocessor) is a general-purpose open source scripting language. The syntax absorbs the features of C, Java, and Perl, facilitates learning, is widely used, and is mainly applied to the web development field. PHP's unique syntax blends C, Java, Perl, and PHP's own syntax.
Dynamic pages made with PHP compared to other programming languages, PHP is embedded in the HTML (Standard Universal Markup Language) document to execute, execution efficiency than the full generation of HTML tag CGI is much higher; PHP can also execute compiled code, Compilation can achieve encryption and optimize code runs, making your code run faster.
Installation
1. Check to see if PHP is currently installed
Rpm-qa|grep PHP
If you have PHP installed, please remove these packages first:
Yum Remove php*
2. Install PHP source
Centos 5 Install PHP Source:
RPM-IVH http://mirror.webtatic.com/yum/el5/latest.rpm
CentOs 6 Install PHP Source:
RPM-IVH http://mirror.webtatic.com/yum/el6/latest.rpm
CentOs 7 Install PHP source and epel extension Source:
RPM-IVH HTTPS://MIRROR.WEBTATIC.COM/YUM/EL7/EPEL-RELEASE.RPMRPM-IVH https://mirror.webtatic.com/yum/el7/ webtatic-release.rpm
3. Start installing PHP now
Install the basic installation package for php5.5:
Yum install php55w php55w-gd php55w-mbstring php55w-mysql
Install the basic installation package for php5.6:
Yum install php56w php55w-gd php56w-mbstring php56w-mysql
Install the basic installation package for php7.0:
Yum install php70w php70w-gd php70w-mbstring php70w-mysql
You will need to restart Apache after installing PHP:
Service restart
4. Test Web page
I installed the php7.0, take php7.0 to write a Web test
/var/www/html/index.php<?php phpinfo ();?>