Skip to content

Instantly share code, notes, and snippets.

@hyrious
Last active April 27, 2017 11:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hyrious/204a97f5112d469459c0b44f5e5b66f7 to your computer and use it in GitHub Desktop.
Save hyrious/204a97f5112d469459c0b44f5e5b66f7 to your computer and use it in GitHub Desktop.
php on Windows
@echo off
setlocal EnableDelayedExpansion
if "%*" == "" (
echo Nothing todoy. ^(^^_^^^)
) else if "%*" == "list" (
call tasklist /fi "ImageName eq php-cgi.exe"
) else if "%*" == "stop" (
<nul set /p=Killing php-cgi.exe..^
call taskkill /f /im php-cgi.exe >nul 2>&1
echo Done.
) else if "%1" == "start" (
goto kira
) else call php-cgi.exe %*
goto :EOF
:kira
<nul set /p=Starting php-cgi.exe..^
set cmdline=
shift
:pp_loop
if "%1" == "" goto :pp_next
set cmdline=%cmdline% %~1
shift
goto :pp_loop
:pp_next
start /b php-cgi.exe %cmdline%
echo Done.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment