Lnmp compiled and installed PHP installation--graphic details

Source: Internet
Author: User

Lnmp compiled and installed PHP installation--graphic details

1. Preface

This installation uses the source code installation, the main resource pack downloads from the official website, the secondary dependence uses the Yum installs, this article only involves the PHP installment, does not involve the PHP configuration, corresponds to nginx how accesses the PHP, this article also does not involve. This tutorial is purely for installation and does not involve any important knowledge points, and is suitable for all ages.

2. Installation Steps

PHP Official website: http://www.php.net/

2.1. Download PHP

wget Http://php.net/get/php-7.1.7.tar.gz/from/a/mirror

2.2. Unzip the PHP installation package

TAR-ZXVF Mirror

2.3. Install dependent Packages

Yum Install gcc gcc++ libxml2-devel

2.4. Generate Makefile File

CD php-7.1.7/

./configure--PREFIX=/USR/LOCAL/PHP7--ENABLE-FPM

Makefile Build Complete

2.5. Compiling && installing

Make && make install

Compile and install complete

Here, the PHP installation is complete.

3. Add to environment variable

3.1,/usr/local/php7/bin/php-v (view PHP version)

You can see the version number, which indicates that the PHP installation was successful.

3.2. Edit environment variable file

Vi/etc/profile +

Add a row at the end

Export path= $PATH:/usr/local/php7/bin

3.3. Refresh the environment variable file

Source/etc/profile

3.4. Re-Test

Php-v

Here, PHP can be used globally.

Lnmp compiled and installed PHP installation--graphic details

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.