Skip to content

Instantly share code, notes, and snippets.

@severak
Last active September 26, 2018 08:46
Show Gist options
  • Save severak/2600b49caae377a594d7585128495895 to your computer and use it in GitHub Desktop.
Save severak/2600b49caae377a594d7585128495895 to your computer and use it in GitHub Desktop.
php-fcgi runner for windows
@ECHO OFF
rem (c) Severak 2018
SETLOCAL
IF "%1"=="start" goto f_start
IF "%1"=="stop" goto f_stop
echo Usage:
echo fcgiserver start [port=9000]
echo fcgiserver stop
goto f_eof
:f_start
set _port=9000
if "%2" neq "" set _port=%2
echo Starting PHP-FCGI server...
set PHP_FCGI_CHILDREN=30
set PHP_FCGI_MAX_REQUESTS=4000
start "PHP-CGI server" /B php-cgi -b localhost:%_port%
goto f_eof
:f_stop
echo Stopping PHP-FCGI server...
taskkill /f /IM php-cgi.exe
goto f_eof
:f_eof
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment