开发者

Question about Pycron for windows

开发者 https://www.devze.com 2023-01-25 05:40 出处:网络
Hi I test my web on my localhost(winxp+ie8+mysql5.0.51a+PHP 5.2.11+Apache 2.2.13). I want to add some cron job for my php files. I select Pycron. After configuration, I add som开发者_Python百科e comma

Hi I test my web on my localhost(winxp+ie8+mysql5.0.51a+PHP 5.2.11+Apache 2.2.13). I want to add some cron job for my php files. I select Pycron. After configuration, I add som开发者_Python百科e command in crontab.txt * * * * * "C:\Program Files\Internet Explorer\IEXPLORE.EXE" http://localhost/test/index1.php. It is success, it will open IEXPLORE.EXE and load index1.php for every minute. But it still open the IEXPLORE windows, not for close. how to set it automatic finish the php job, then close the IEXPLORE windows? thanks.


how about using a command-line utility such as Curl or wget: http://gnuwin32.sourceforge.net/packages/wget.htm? Or use Python with urllib/urllib2?


To fire a local PHP event through Pycron, you'll want to do something like this:

First create a new task. Then for the "Command" box in Pycron, enter the location of your PHP.exe file, eg "C:\Program Files (x86)\PHP\v5.3\php.exe"

for the "Parameters" box enter the location of the php file you want to run eg "C:\websites\mysite.com\cron.php"

You don't want to run any of that through Internet Explorer. Fire it directly at the PHP executable. Your server will thank you.

0

精彩评论

暂无评论...
验证码 换一张
取 消