Php-cgi.exe often crash, what is the reason? The nginx + php environment php-cgi.exe built on the machine often crash, what is the reason? Nginx + php environment built on the local machine
Reply content:
Php-cgi.exe often crash, what is the reason? Nginx + php environment built on the local machine
Send the error report. Otherwise, how can I know the cause of the crash.
I suggest using a one-click package in a non-production environment. if something goes wrong, you can recover it or change the installation to save your effort (XD)
The program may be corrupted, the code may be faulty, or you have used some unstable php extensions. Or some anti-virus software mistakenly kills this process.
After reading people's source code, add an environment variable:
Although php-cgi supports running in the background, this operation mode is unstable.
So there will be CGI process manager and other things to solve this problem.
The following describes Apache, Nginx, and IIS functions.
For example, the Apache FastCGI Process Manager module mod_fcgid has the function of managing and maintaining the number of PHP-CGI processes, andmod_proxy_fcgi
Nginx fastcgi_pass is similar, that is, Nginx is not responsible for managing the CGI process at the backend, and Nginx is only responsible for proxy. linux often with Nginx use PHP-FPM can manage their own PHP-FPM sub-process (with PHP-CGI process irrelevant), so very stable. microsoft also developed a PHP-CGI process Manager PHP Manager for IIS.
Finally, we will summarize the common PHP running methods:
Nginx fastcgi_pass <=> PHP-FPMApache + mod_proxy_fcgi <=> PHP-FPMApache + mod_php <=> libphp5.so/php5apache2_4.dllApache + mod_fcgid <=> PHP-CGIIIS + PHP Manager <=> PHP-CGI