Php
Download
http://www.php.net/downloads.php
Installation
Yum-y Install libxml2-devel libcurl-devel libjpeg-devel libpng-devel freetype-devel libxslt-devel gcc gcc-c++
Openssl-devel
Tar XF php-7.2.3.tar.bz2-c/tmp
./configure--prefix=/usr/local/php--with-curl--with-freetype-dir--with-gd--with-gettext--with-iconv-dir--with-
Jpeg-dir--with-kerberos--with-libdir=lib64--with-libxml-dir--with-mysqli--with-openssl--with-pcre-regex--with-
Pdo-mysql--with-pdo-sqlite--with-pear--with-png-dir--with-xmlrpc--with-xsl--with-zlib--enable-fpm--enable-
Bcmath--enable-libxml--enable-inline-optimization--enable-mbregex--enable-mbstring--enable-opcache--
Enable-pcntl--enable-shmop--enable-soap--enable-sockets--enable-sysvsem--enable-xml--enable-zip--with-
Fpm-group=nginx--with-fpm-user=nginx
Make
Make install
CP sapi/fpm/init.d.php-fpm/etc/init.d/php-fpm && chmod 755/etc/init.d/php-fpm #RHEL6 startup script
CP sapi/fpm/php-fpm.service/usr/lib/systemd/system/#RHEL7 Startup script
cp/usr/local/php/etc/{php-fpm.conf.default,php-fpm.conf} #php The-FPM master configuration file
Cp/usr/local/php/etc/php-fpm.d/www.conf{.default,} # PHP-FPM child configuration file
CP Php.ini-production/usr/local/php/lib/php.ini # Main configuration file for PHP
Note: If you do not specify a path using the--with-config-file-path=/path parameter at./configure, the default PHP configuration file path
Under the/usr/local/php/lib; If the./configure is not using--with-fpm-group=nginx--with-fpm-user=nginx, the default php-
The owner and genus of the fpm process are nobody
[[email protected] php-fpm.d]# GREP-PV "^ ($|#|;)"/usr/local/php/etc/php-fpm.d/www.conf [www] user = Nginx
Group = Nginx Listen = 127.0.0.1:9000 #跟据环境所需改变绑定的IP与监听的port pm = Work of dynamic #php-FPM
mode, recommended dynamic Pm.max_children = 5 Pm.start_servers = 2 Pm.min_spare_servers = 1
Pm.max_spare_servers = 3
[Email protected] ~]# systemctl start php-fpm
[[email protected] ~]# lsof-i:9000 COMMAND PID USER FD TYPE DEVICE size/off NODE NAME php-fpm 84636
Root 6u IPv4 206840 0t0 tcp Localhost:cslistener (LISTEN) main process php-fpm 84637 nginx 0u IPv4 206840 0t0 TCP
Localhost:cslistener (LISTEN) worker process php-fpm 84638 nginx 0u IPv4 206840 0t0 TCP Localhost:cslistener
(LISTEN)
Add the module that calls fastcgi in the Nginx configuration file:
Description:/data/wwwroot is the path of PHP storage; PHP-FPM and Nginx can be detached (deployed on different servers)
Phpredis
Validation: Redis-related modules can be found when using the Phpinfo () function output
Optimization of PHP
No.6 basic configuration and optimization of PHP