Home > Backend Development > PHP Tutorial > nginx - php-cgi.exe process automatically exits

nginx - php-cgi.exe process automatically exits

PHP中文网
Release: 2023-03-01 07:18:01
Original
2380 people have browsed it

When configuring the nginx+php operating environment under a windows server, the php-cgi.exe process will automatically exit after the server has been running for a period of time? Could you please tell me how to configure the server?

Reply content:

win32+nginx+php automatically hangs php-cgi.exe
RunHiddenConsole E:/wnmp/php5/php-cgi.exe -b 127.0.0.1:9000 -c "E:/wnmp/ php5/php.ini"
Step 1: Download xxfpm, the address is not provided, search on Baidu, there are many.

Downloaded

Step 2: Create a new text and write the following code.

RunHiddenConsole.exe H:/Server_Core/xxfpm/bin/xxfpm.exe "H:/Server_Core/PHP/php-cgi.exe -c 
H:/Server_Core/PHP/php.ini" -n 2 -i 127.0.0.1 -p 9000
Copy after login

Explanation:
RunHiddenConsole.exe is a window hiding tool, because if you don’t use this, the CMD window will always be open. If you close the window, the process will exit. Oh, there is no such thing, so this You also need to download it, and put the RunHiddenConsole.exe and php-cgi.bat in your PHP root directory. The 2 in the above code refers to opening two php-cgi.exe processes. The specific situation is based on your own requirements. Yes, but it is not recommended to open a process. The specific reasons will be updated in a future blog. In addition, we will talk about load balancing in the future. At that time, the 2 will be changed to 1.
The code 9000 above refers to PHP transmission through port 9000
Warm reminder: The slash in the code must use "/" instead of "". Replace the path in the code with your actual configuration path, and so on.
OK, after saving, rename the TXT text to php-cgi.bat, save it, and click it again, haha, the process is running stably. . .

The above is the content of the nginx-php-cgi.exe process automatically exiting. For more related content, please pay attention to the PHP Chinese website (www.php.cn)!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template