CentOS Install PHP High version _linux

Source: Internet
Author: User

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 ();?>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.