-
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathrestart_php.bat
More file actions
33 lines (23 loc) · 830 Bytes
/
restart_php.bat
File metadata and controls
33 lines (23 loc) · 830 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
@echo off
IF [%~1] == [] GOTO usage
if [%~2] == [] (
set cgi_port=9000
) else (
set cgi_port=%~2
)
if [%~3] == [] (
set cgi_instances=4
) else (
set cgi_instances=%~3
)
taskkill /im php-cgi-spawner.exe /F > NUL 2>&1
taskkill /im php-cgi.exe /F > NUL 2>&1
@rem set PHP_FCGI_MAX_REQUESTS=0
@rem start "PHP %1 FastCGI" /B "%1\php-cgi.exe" -b localhost:%cgi_port%
start "PHP %1 FastCGI Spawner" /B "php-cgi-spawner.exe" %1/php-cgi.exe %cgi_port% %cgi_instances%
echo Started %cgi_instances% PHP %1 FastCGI on port %cgi_port%.
GOTO :EOF
:usage
echo Kills existing php-cgi processes and then starts specified process from directory specified.
echo Usage is "restart_php php55" to start php-cgi from php55 directory.
echo You could also specify number of instances to spawn and a port to bind to "restart_php php55 4 9000".