Cronjob使用CURL / WGET [英] Cronjob using CURL/WGET
本文介绍了Cronjob使用CURL / WGET的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想使用CURL或WGET每15分钟运行一次PHP脚本。
I want to run a PHP script every 15 minutes using either CURL or WGET.
此PHP文件位于本地文件夹中:
This PHP file is in a local folder:
/home/x/cron.php
$ b b
我如何使用CURL / WGET来运行它?
How would I run this using CURL/WGET?
当我尝试运行
curl /home/x/cron.php
谢谢!
推荐答案
CURL和WGET对于像 http://myhost.com/cron.php
CURL and WGET are more adecuate for URLs like http://myhost.com/cron.php
脚本离线时,最好使用php CLI运行它:
When the script is offline, you would better run it using php CLI:
例如:
php -q cron.php
这篇关于Cronjob使用CURL / WGET的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文