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