Nginx Programming Development tutorial-PHP compilation and installation method, nginx Programming Development

Source: Internet
Author: User

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;
? ? ? ? }

? ?? ??

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.