A case of using RunHiddenConsole to start nginx and php under windows

黄舟
Release: 2023-03-16 20:44:01
Original
1541 people have browsed it

Use RunHiddenConsole to start nginx and php

RunHiddenConsole.exe is to automatically close the script after executing the command line script. Processes started from scripts are not closed. To put it simply, the black form (CMD command form) will not be displayed, but the programs running in the CMD command form will not be closed, especially some commands that will hang and must display the command form, such as Tomcat. , Php, Nginx, etc.

1. Start Php and Nginx, set php_home and nginx_home according to your own environment, and then save it as a .bat file.

@echo off 
set php_home=./php/php-5.6.1-nts-Win32-VC11-x64 
set nginx_home=./nginx/nginx-1.7.4 
 
REM Windows 下无效 
REM set PHP_FCGI_CHILDREN=5 
 
REM 每个进程处理的最大请求数,或设置为 Windows 环境变量 
set PHP_FCGI_MAX_REQUESTS=1000 
 
echo Starting PHP FastCGI... 
RunHiddenConsole %php_home%/php-cgi.exe -b 127.0.0.1:9000 -c %php_home%/php.ini 
 
echo Starting nginx... 
RunHiddenConsole %nginx_home%/nginx.exe -p %nginx_home%
Copy after login

2. Close Php and Nginx

@echo off 
echo Stopping nginx... 
taskkill /F /IM nginx.exe > nul 
echo Stopping PHP FastCGI... 
taskkill /F /IM php-cgi.exe > nul 
exit
Copy after login

The above is the detailed content of A case of using RunHiddenConsole to start nginx and php under windows. For more information, please follow other related articles on the PHP Chinese website!

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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!