I've installed Apache 2.4 with PHP 5.4 on Windows Server 2008 following instructions from this manual: Apache installing manual. Apache runs as a service now.
My application requires a php websocket script to run in the background. I'm running it manually with:
php myscript.php
The question is: Is there a way to start a background script automatically on system(apache) restart?
I found the following topic, but I didn't know where I could find an apache startup script for Windows.
Any help will be much appriciated.
I come up with a solution :)
APACHE_HOME = C:/PATH/TO_APACHE
%APACHE_HOME%\bin\httpd.exe
to %APACHE_HOME%\bin\httpdVendor.exe
php myscript.php
%APACHE_HOME%\bin\httpdVendor.exe -k runservice
exit 0
%APACHE_HOME%\bin\httpd.exe
Tested on : Windows 7, Apache 2.4, Advanced Bat to Exe Converter 2.92
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With