LNMP compilation and installation-php installation-graphic explanation,

Source: Internet
Author: User

LNMP compilation and installation-php installation-graphic explanation,
LNMP compilation and installation-php installation-graphic explanation

1. Preface

This installation uses the source code for installation. The main resource package is downloaded from the official website, and the secondary dependency is installed using yum. This article only involves the installation of php, does not involve the configuration of php, and corresponds to how nginx accesses php, this article does not cover. This tutorial is purely installed and does not involve any important knowledge. It 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 decompress the php installation package

Tar-zxvf mirror

2.3 install dependency packages

Yum install gcc ++ libxml2-devel

2.4 generate makefile

Cd php-7.1.7/

./Configure -- prefix =/usr/local/php7 -- enable-fpm

Makefile generation complete

2.5 compile & Install

Make & make install

Compilation and installation completed

Now php installation is complete.

 

3. Add to Environment Variable

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

 

The version number indicates that php is successfully installed.

3.2. Edit the 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

By now, php can be used globally.

 

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.