2

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
Community
  • 1
  • 1
Lajos Arpad
  • 64,414
  • 37
  • 100
  • 175
  • 1
    @Machavity, thank you for pointing that post out. I have read that one as well and my question is slightly different. I specified in my question that I intend to do this with WAMP, while the other question is less specific and therefore allows solutions outside of WAMP. I am not against closing this question if it considered to be a duplicate, but would like to know an answer without environment variables, batch files, windows startup events or third-party tools. Is this possible solely with Apache? – Lajos Arpad Oct 13 '16 at 18:07
  • AFAIK the Apache within WAMP is basically the same as a vanilla Apache install (just tied to the central config setup system). Did you try their solutions? They look very viable. – Machavity Oct 13 '16 at 18:23
  • @Machavity, the best thing I found is the link in the question, but I do not know where that script should be added. I can see now that a part of my question is not visible. I will edit my question to make the invisible part visible, my bad. – Lajos Arpad Oct 13 '16 at 18:38
  • @Machavity, sorry, I see it was visible but not well-formed. – Lajos Arpad Oct 13 '16 at 18:40
  • @Machavity, I am still trying, but with no luck. – Lajos Arpad Oct 13 '16 at 20:00
  • not, the syntax is NOT the same. you're on Windows, and that example is for Unix/Linux. the concept remains the same: they're just inserting a command to run a new script into the script that starts apache. you'd have to find whatever wamp uses to start apache and insert your command there. – Marc B Oct 13 '16 at 20:06
  • @MarcB, that is what I am trying for hours, but I lack the necessary WAMP knowledge to do it. – Lajos Arpad Oct 13 '16 at 20:19

1 Answers1

0

I have asked the same question at WAMP's forum and the answer was:

Hi,

Is it possible to launch a php script at apache startup?

No. Not with Wampserver.

The answerer was a moderator, therefore I have to believe that, unfortunately the answer is: no, that's not possible.

Lajos Arpad
  • 64,414
  • 37
  • 100
  • 175