How can I automatically run a PHP script on WAMP start?
Posted by: lajosarpad (---.rdsnet.ro)
Date: October 14, 2016 02:56PM

I have a WAMP environment and would like to support WebSockets. For this purpose I bought a module and installed it. However, I would like to be able to run a standalone script once WAMP is started. However, after a long search I did not find out how can I do this with WAMP.

I have, among others read this: Is it possible to launch a php script at apache startup?

However, I do not have an etc folder and I am confused about what should be done and where. The suggested example is:

restart)
[..]
php -q /tmp/myscript.php &
;;

which is nice, I want it to be executed as a background script, but:

I do not know where should this be included
I would like to execute the script on start as well
I wonder whether the syntax is the same for WAMP
I hope that this will not run in the background even if Apache is stopped

Options: ReplyQuote
Re: How can I automatically run a PHP script on WAMP start?
Posted by: Otomatic (Moderator)
Date: October 14, 2016 04:07PM

Hi,

> Is it possible to launch a php script at apache startup?
No. Not with Wampserver.

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote
Re: How can I automatically run a PHP script on WAMP start?
Posted by: lajosarpad (---.rdsnet.ro)
Date: October 14, 2016 04:21PM

So, there is no PHP script where I could write

include_once($mypath);

?

Options: ReplyQuote
Re: How can I automatically run a PHP script on WAMP start?
Posted by: Otomatic (Moderator)
Date: October 14, 2016 05:23PM

Hi,

It is only possible to launch localhost at the startup of Wampserver :
- Right-Click Wampmanager icon -> Wamp settings -> Wampserver Homepage at startup

The homepage is wamp/www/index.php

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote
Re: How can I automatically run a PHP script on WAMP start?
Posted by: lajosarpad (---.rdsnet.ro)
Date: October 14, 2016 05:57PM

Thank you for your answer. It seems that I will have to write a batch file which will start WAMP, wait for a minute and run my script.

Options: ReplyQuote


Sorry, only registered users may post in this forum.