简体   繁体   中英

Running continuous PHP (script) background processes on a WAMP server

I got the 140dev Twitter framework (which uses the Twitter phirehose) manually running (via the webbrowser on my local wamp server), but I can't figure out how to run both get_tweets.php and parse_tweets.php as a background process like with SSH commands:

nohup php script.php > /dev/null &

Some of you started using (the Windows equivalent of) cronjobs, but this isn't the right way to go. I think this is because of creating multiple connection (or re-connections) to the Twitter streaming phirehose isn't allowed? How can I run both PHP scripts (get_tweets.php and parse_tweets.php) as a background process on my local WAMP server (and later on a VPS)?

Just to clearify:

  • I am using a WAMP server (first to test a little bit and later to run it on a VPS)
  • Using LAMP or any *nix server/system isn't an option (due to time, experience and lack of skills)
  • I have searched for solutions (on google and stackoverflow), but they are either not working or not clear enough for me (I am new to this)

Thank you in advance.

Find the php/bin folder where the php.exe is located. Copy the folder path and add it to your PATH environment variable (Follow this for instance to edit your PATH variable.

Once this is done, you'll be able to execute php in the command line from anywhere. Just start php script.php with a command line in the right folder and it should work. There might be some configuration to make so that the php in command line uses WAMP's php.ini.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM