Nginx Programming Development tutorial-PHP compilation and installation method, nginx Programming Development
Get PHP:
???? Http://php.net /????
Compile and install PHP:
???? Yum-y install libxml2-devel? ? # Install the dependency package first
???? Yum-y install curl-devel
???? Yum-y install libjpeg-devel
???? Yum-y install libpng-devel
???? Yum-y install freetype-devel
???? Yum install-y libmcrypt-devel
????. /Configure? ? -- Prefix =/usr/local/php? ? -- Enable-fpm? ? -- With-zlib? ? -- Enable-zip? ? -- Enable-mbstring? ? -- With-mcrypt? ? -- With-mysql? ? -- With-mysqli? ? -- With-pdo-mysql? ? -- With-gd? ? -- With-jpeg-dir? ? -- With-png-dir? ? -- With-freetype-dir? ? -- With-curl? ? -- With-openssl? ? -- With-mhash? ? -- Enable-bcmath? ? -- Enable-opcache ?? ? # Compile
????
? ? Make & make install ????
????? ?
PHP and Nginx integration :? ? Configure PHP-FPM
????? ? Cd? /Usr/local/php/etc
???????? Cp php-fpm.conf.default php-fpm.conf
???????? Cp/tmp/php-5.6.33/sapi/fpm/init. d. php-fpm/etc/init. d/php-fpm? ? # Configure the service mode to run
???????? Chmod + x/etc/init. d/php-fpm
???????? Chkconfig -- add php-fpm
????????
???????? Service php-fpm start? ? # Netstat-tlnp | grep php view port
???????? Service php-fpm reload
???????? Service php-fpm restart
???????? Service php-fpm stop
???? Configure PHP :????? ? Cp/tmp/php-5.6.33/php. ini-development/usr/local/php/lib /? ? # Change the name to php. ini.
???????? Cp/tmp/php-5.6.33/php. ini-development/usr/local/php/lib/
???????? Cp/tmp/php-5.6.33/php. ini-development/usr/local/php/lib/php. ini
? ? Nginx supports PHP :???????? Root html;
Index index.html index.htm index. php;
? ? ? ? Location ~ \. Php $ {
? ? ? ? ????? Try_files $ uri = 404
? ? ? ? ? ? Fastcgi_pass? 127.0.0.1: 9000;
? ? ? ? ? ? # Fastcgi_param? SCRIPT_FILENAME? /Scripts $ fastcgi_script_name;
? ? ? ? ? ? # Include? ? ? ? Fastcgi_params;
Include? ? ? ? Fastcgi. conf;
? ? ? ? }
? ?? ??