The method described in this article should be the quickest way to get PHP (PHP tutorial) Now: Nginx + php-fpm + APC. We will be from the installation of Nginx HTTP server, PHP and PHP-FPM patches, as well as APC, detailed explanation of this method
The relationship between fast-cgi CGI Nginx PHP-FPMFAST-CGI is developed by CGI, is the interface between HTTP server (Http,nginx, etc.) and dynamic scripting language (Php,perl, etc.), just an interface, he is in the form of a socket (can be a file
According to official documentation 5.4.0, this function can be used for FastCGI. Previously, it was only supported when PHP was running as an Apache module. However, when I call this function in Nginx + php-fpm mode, an undefined error is returned.
1. the larger the worker_processes, the better (the higher the performance after a certain number is not obvious) 2. worker_cpu_affinity all CPUs share worker_processes, which is better than every worker_processes for cross-cpu allocation. php
Solution to 502badgateway error in nginx + php-fpm
1. nginx error cannot be found. Generally, You need to modify/usr/local/nginx/conf/nginx. conf (careful modification may cause other website problems)
Error 2,502
Case 1: nginx
Nginx + php-fpm error 502 bad gateway solution, nginxphp-fpm
1. nginx error cannot be found. Generally, You need to modify/usr/local/nginx/conf/nginx. conf (careful modification may cause other website problems)
Error 2,502
Case 1: nginx
YII application Apache configuration is relatively simple, nginx configuration mainly need to deal with a single entry file, which corresponds to the Apache configuration in the following sentence:
# If a directory or a file exists, use it
In the Nginx and PHP environment, the configuration of a WordPress, access to find PHP page has been shown blank, at first thought to be a privilege issue, the right to change to 755 or not.Then, open Nginx and PHP logs, but in the log also found no
Nginx + php-fpm-fcgi, some of the site's pages are blank (note: Not all dynamic pages can not be displayed) what is going on?
For example, Zencart old Orchid Pavilion template backstage Normal (into the background of the default turn on the
FPM with PHP.ini (/etc/php5/fpm/php.ini), it is important to not change the security loopholes.Cgi.fix_pathinfo=0Remove anti-SYN flood attacks (high concurrency will actively clog Apache requests resulting in AB test under Apr_socket_recv:connection
Referencehttp://xieminis.me/?p=216But he's not clear about the authority.There is no big difference between socket and TCP mode performancehttp://blog.csdn.net/liv2005/article/details/7741732/etc/php-fpm.d/www.conf;listen = 127.0.0.1:9000
/etc/php-fpm.d2.1 Number of processes PHP-FPM initial/idle/MAX worker processes Pm.max_children = Pm.start_servers = Pm.min_spare_servers = 5 Pm.max_spare_servers = 2.2 Maximum number of processing requests the maximum number of processing requests
Nginx php-fpm with the UNIX socket, when the concurrency reached more than 100 is, will report 502 errors, change to TCP mode without this problemOriginally with UNIX socket is to improve performance, but does not support large concurrency, the
When you encounter this problem, first confirm that you are in the Web server configuration. PHP is not assigned to FASTCGI server processing:Location ~ . php$ { 127.0. 0.1:9000;}If configured, it may be caused by an incorrect path to the
502,504 errors often occurIdeas:
Increase the size and number of cache files when Nginx communicates with PHP-FPM
5 PHP-FPM processes are statically bound, reducing the overhead of the frequency start process
Using sock files
Nginx itself cannot handle PHP, it is just a Web server, when the request is received, if it is a PHP request, then sent to the PHP interpreter processing, and return the results to the client.Nginx is generally the request to send fastcgi
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.