简体   繁体   English

在WAMP服务器上运行连续的PHP(脚本)后台进程

[英]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: 我得到了140dev Twitter框架(使用Twitter phirehose)手动运行(通过本地wamp服务器上的webbrowser),但是我不知道如何将get_tweets.php和parse_tweets.php作为后台进程运行,例如: SSH命令:

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. 你们中的一些人开始使用cronjobs(相当于Windows),但这不是正确的方法。 I think this is because of creating multiple connection (or re-connections) to the Twitter streaming phirehose isn't allowed? 我认为这是因为不允许与Twitter流phihose建立多个连接(或重新连接)吗? 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)? 如何在本地WAMP服务器(以及以后的VPS)上同时运行两个PHP脚本(get_tweets.php和parse_tweets.php)作为后台进程?

Just to clearify: 只是为了澄清:

  • I am using a WAMP server (first to test a little bit and later to run it on a VPS) 我正在使用WAMP服务器(首先进行一点测试,然后再在VPS上运行它)
  • Using LAMP or any *nix server/system isn't an option (due to time, experience and lack of skills) 不能选择使用LAMP或任何* nix服务器/系统 (由于时间,经验和缺乏技能)
  • 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) 我已经搜索了解决方案(在google和stackoverflow上),但是它们要么无法正常工作,要么对我来说不够清晰(我是新来的)

Thank you in advance. 先感谢您。

Find the php/bin folder where the php.exe is located. 找到php.exe所在的php/bin文件夹。 Copy the folder path and add it to your PATH environment variable (Follow this for instance to edit your PATH variable. 复制文件夹路径并将其添加到您的PATH环境变量中(例如,按照此步骤编辑PATH变量。

Once this is done, you'll be able to execute php in the command line from anywhere. 完成此操作后,您将可以在命令行中的任何位置执行php。 Just start php script.php with a command line in the right folder and it should work. 只需在正确的文件夹中使用命令行启动php script.php ,它就可以工作。 There might be some configuration to make so that the php in command line uses WAMP's php.ini. 可能需要进行一些配置,以便命令行中的php使用WAMP的php.ini。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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