Debain cron help accessing a URL
listed in answer
ANSWER:
There is a slight difference of how you call a PHP script and especially how it will process the given parameters. The documentation refers a request via a HTTP GET request and you are using a command line call of a PHP script.
Example of a HTTP GET request executed via command line:
wget -q -O - "http://localhost/domain-manager/cron.php?cron=do&d=31"
Example of executing a PHP script via command line:
php -f /var/www/website/public/domain-manager/cron.php cron=do d=31
The main difference is how PHP will get the parameters. For the HTTP request PHP will use an interface to Apache or whatever web server you are using and fetch parameters in a $_GET array. For the command line call PHP must use the $argv array.
If the documentation requires a HTTP call I would use it, even if the command line call will be better for performance reasons and does not have such limitations.
Recommendation for your crontab:
*/2 * * * * wget -q -O - "http://localhost/domain-manager/cron.php?cron=do&d=31" > /dev/null 2>&1
Recommendation for protecting this file from external request:
Content of /var/www/website/public/domain-manager/.htaccess (in same directory)
order deny,allow
deny from all
allow from localhost
by Jens Bradler from http://serverfault.com/questions/384102

New Comments