I've been trying to create a script that is supposed to run in crontab.
I've allready tested it in Browser and everything works well. Then, i added a line on the top of the script like this: #!/usr/bin/php -q.
When i try to run it from the command shell (php script.php) on suse linux 9 Pro, it works but everytime i try to do it from the crontab, it returns me this error:
Code: Select all
Usage: php [options] [-f] <file> [args...]
php [options] -r <code> [args...]
php [options] [-- args...]
-a Run interactively
-c <path>|<file> Look for php.ini file in this directory
-n No php.ini file will be used
-d foo[=bar] Define INI entry foo with value 'bar'
-e Generate extended information for debugger/profiler
-f <file> Parse <file>.
-h This help
-i PHP information
-l Syntax check only (lint)
-m Show compiled in modules
-r <code> Run PHP <code> without using script tags <?..?>
-s Display colour syntax highlighted source.
-v Version number
-w Display source with stripped comments and whitespace.
-z <file> Load Zend extension <file>.
args... Arguments passed to script. Use -- args when first argument
starts with - or script is read from stdinThe line in crontab looks like this: 30 0 * * 2-4 root php /srv/www/htdocs/script.php
Code: Select all