php-7.0.18version (compiled and installed)-Customizing the installation path
installation path:/application/php-7.0.18
1.Pre-PreparationInstalling the GCC and gcc-c++ required for compilation
Yum install-y gcc gcc-c++
PHPDependent
Libxml2-devel,openssl-devel,curl-devel,libjpeg-devel,libpng-devel, freetype-devel,openldap-devel,libmcrypt-devel
Yum-y Install libxml2-devel openssl-devel curl-devel libjpeg-devel libpng-devel freetype-devel openldap-devel Libmcrypt-devel
Download the PHP source package and Unzip it
Cd/toolswget HTTP://CN2.PHP.NET/DISTRIBUTIONS/PHP-7.0.18.TAR.GZTAR-ZXF php-7.0.18.tar.gz
2.phpCompiling the installationGenerate Makefile File
CD php-7.0.18./configure--prefix=/application/php-7.0.18--with-mysqli--enable-mbstring--enable-fpm
Require additional functionality to add it yourself
compiling the source code and installing
Make && make install
3.Late EndCreate a soft link to php-7.0.18 remove the end version number
Ln-s/application/php-7.0.18//application/php
Adding environment Variables
Create a php command soft link to an environment variable
Ln-s/application/php/sbin/*/usr/local/sbin/ln-s/application/php/bin/*/usr/local/bin/
Configure PHPCopy configuration file
#引擎配置文件: Php.inicd/application/phpcp/tools/php-7.0.18/php.ini-development/application/php/etc/php.ini # Service configuration file: Php-fpm.confcd/application/php/etc/cp php-fpm.conf.default php-fpm.conf cd/application/php/etc/php-fpm.d/ CP Www.conf.default www.conf
Modify the service configuration file
Run as Nginx phpsed -i ' s#nobody#nginx#g ' www.conf turn on slow query log sed -i ' s#;slowlog#slowlog#g ' www.conf open mail settings sed -i ' s#;p hp_admin_value\[sendmail_path\]# Php_admin_value\[sendmail_path\] #g ' www.conf Modify recipient sed -i ' s#[email protected]#[email Protected] #g ' www.conf open pid file sed -i ' s#;p id#pid#g ' /application/php/etc/ Php-fpm.conf Open error log sed -i ' s#;error_log#error_log#g ' /application/php/etc/php-fpm.conf modify error level SED -i ' S#;log_level = notice#log_level = error#g ' /application/php/etc/ Php-fpm.conf Modify the number of file descriptors sed -i ' s#;rlimit_files = 1024#rlimit_files = 32768#g ' /application/php/etc/php-fpm.conf modified to asynchronous Model sed -i ' S#;events#events#g ' /application/php/etc/ Php-fpm.conf
5.Common CommandsStart PHP-FPM
Php-fpm-c runs with the specified engine configuration file, not the default php-fpm-c/application/php/etc/php.ini
Stop PHP-FPM
Kill-sigquit $ (cat/application/php/var/run/php-fpm.pid) #平滑终止kill-sigint $ (cat/application/php/var/run/ PHP-FPM.PID) #立刻终止
Restart php-fpm
KILL-SIGUSR2 $ (cat/application/php/var/run/php-fpm.pid) #平滑重启
Signal Interpretation:
SIGINT, SIGTERM immediately terminate .
Sigquit Smooth Termination
SIGUSR1 reopen log file
SIGUSR2 smoothly overloads all worker processes and reloads the configuration and binary modules
This is your choice | Czlunsu "blog, be sure to keep this source http://czlun.blog.51cto.com/9876583/1945879
php-7.0.18 version (compiled installation)-Custom installation path