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