1. Download the required components
sudo apt-get install Libxml2-dev
sudo apt-get Install Curl
2. Start the configuration installation
3. Modify the PHP-FPM configuration file (php-fpm parameter details )
Include=/home/php/etc/php-fpm.d/*.conf
cd/home/php/etc/php-fpm.d/
Vim/home/php/etc/php-fpm/www.conf
Modify the extension configuration file for php-fpm www.conf
== www##### #根据nginx. conf in configuration Fastcgi_pass unix:/home/php/var/run/php-fpm.sock127.0 . 0.1:9000 =/home/php/var/run/php-fpm.sock=/var/log/php-fpm/$ pool-== =/var/lib/php/session
4. Modify PHP.ini
Because the PHP7 INI is in the source file installation package, all the copies must be copied first
CP Php.ini-development/home/php/etc/php.ini
Vim/home/php/etc/php.ini
##### #避免PHP信息暴露在http头中expose_php=off##### #避免暴露php调用mysql的错误信息display_errors=off##### #在关闭display_errors后开启PHP错误日志 (path in PHP-configuration in fpm.conf) log_errors=on##### #设置PHP的扩展库路径extension_dir="/home/php/lib/php/extensions/no-debug-non-zts-20151012/"##### #设置PHP的opcache和mysql动态库zend_extension=opcache.soextension=mysqli.soextension=pdo_mysql.so##### #设置PHP的时区date. TimeZone=prc##### #开启opcache [Opcache]; DeterminesifZend Opcache isenabledopcache.enable=1##### #设置PHP脚本允许访问的目录 (needs to be configured according to the actual situation); Open_basedir=/usr/share/nginx/html;
5. Copy two executable files to the user directory; Enable the program to start quickly
cp/home/php/sbin/php-fpm/usr/local/bin/php-fpm
cp/home/php/bin/php/usr/local/bin/php
This allows you to run PHP-V view version directly
[Email protected]:/home/php/bin# php-7.0. 0 (CLI) (BUILT:APR 52018:1997 - the PHP groupzend Engine v3. 0.0 1998- Zend Technologies
Can run PHP-FPM boot php-fpm
[Email protected]:/home/php/bin# ps-ef|grep php-Fpmroot15846 1 0 -: -?xx:xx:xxPhp-fpm:master Process (/home/php/etc/php-fpm.conf) www15847 15846 0 -: -?xx:xx:xxphp-Fpm:pool wwwwww15848 15846 0 -: -?xx:xx:xxphp-Fpm:pool wwwroot15850 15780 0 -: -pts/0 xx:xx:xxgrep--color=auto PHP-FPM
Common steps to start:
#停用php--int ' cat/home/php/var/run/php-fpm.pid ' #启动php-/home/php/sbin/php- fpm# View php-/home/php/var/run/php-fpm.pid '
Ubuntu Installation php7.0 Environment