Integrated Nginx and PHP configuration

Source: Internet
Author: User
Tags php source code

Nginx itself does not handle the dynamic request, it will pass the request through fastcgi to php,php processing the generated static page and then handled by Nginx.

PHP-FPM is also a third-party fastcgi process Manager, which is developed as a patch for PHP, it also needs to be compiled with the PHP source code at the time of installation, that is, the PHP-FPM is compiled into the PHP kernel, so the performance of the processing is more excellent And it is also much better at handling high concurrency than the spawn-fcgi engine, so it is recommended that this combination of NGINX+PHP/PHP-FPM parse the PHP php5.3 the above version has integrated PHP-FPM into the PHP installation package, php5.2 and the following need to download the expansion pack http://php-fpm.org/downloads/.


server{

Server_namewww.mysite2.name;

return301 $scheme://mysite2.name$request_uri;

}

server{

server_name mysite2.name;


root/usr/share/nginx/mysite2.name/live/;

indexindex.html index.htm index.php;


location/{

Try_files$uri $uri//index.html index.php;

}


location~ \.php$ {

fastcgi_split_path_info^ (. +\.php) (/.+) $;

Fastcgi_passunix:/var/run/php5-fpm.sock;

fastcgi_indexindex.php;

Includefastcgi_params;

}

}


Integrated Nginx and PHP configuration

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.