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.