$_SERVER['DOCUMENT_ROOT']/file.php: line 1: ?php: No such file or directory
$_SERVER['DOCUMENT_ROOT']/file.php: line 2: syntax error near unexpected token `0'
$_SERVER['DOCUMENT_ROOT']/file.php: line 2: `set_time_limit(0);'
the above error, i got while run cron,
can anyone help me... Thanks in Advance..
Regards, Vinoth S
In Linux, you can schedule jobs to run automatically after a stipulated time by entering a command into the crontab file. In this step, you will instruct the crontab daemon to run your /var/www/html/tasks. php script after every minute.
You're directly invoking the .php file. The shell looks for a shebang and finds <?php
which is not a valid command line interpreter.
You'll have to prefix your script with something like:
#!/usr/bin/php5
Or in your crontab:
* * * * * /usr/bin/php5 /path/to/the/script.php
Thank u for all ur comments... its very useful to me... But i try the all the way, But my hosting domain ll not support, thats y i tried,
php -q /path/to/the/script.php
like that, its working fine,My cron now working fine... Thank u all...
Regards, Vinoth S
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With