1 頁 (共 1 頁)

php-cgi.exe as a windows service

發表於 : 2014-12-08 23:27:15
yehlu
http://superuser.com/questions/628176/p ... ws-service

Download the service wrapper

Copy service.exe to your windows directory.

Location: C:\windows\

Open command prompt

Enter the following command

sc create PHP binPath= "service.exe \"C:\php\php-cgi.exe -b 127.0.0.1:9000 -c C:\php\php.ini"" type= own start= auto error= ignore DisplayName= PHP
Note: Adjust paths for both "php-cgi.exe" and "php.ini" according to yours.

Once you have installed the service, you can start it via:

Command line:

sc start PHP // to start PHP service.

sc delete PHP // to delete PHP service

sc stop PHP // to stop PHP service
OR

GUI:

type "services.msc" at run then find "PHP" from the list and right click on it and select Start.