centos cron job running php file
- by user50946
I have a php file under php called test.php set to run every 5th minute of the hour.
When ever I run the file manually (by going to the web browser and runnint the path) it works fine. But when the cron job tries to run it I get the error message
my cron job is
#### Delete Records
5 * * * * /var/www/html/phpsysinfo/cronUpdateLeadBucketOnEnergycAlliance.php
my phpfile is (path : /var/www/html/phpsysinfo/phpfile)
<?php
require("dbconnect.php");
$sql = mysql_query("DELETE FROM list where status <> 'LEAD'") or die(mysql_error());
?>
and the error that I get is:
/var/www/html/phpsysinfo/phpFile.php: line 1: ?php: No such file or directory
/var/www/html/phpsysinfo/phpFile.php: line 2: syntax error near unexpected token `"dbconnect.php"'
/var/www/html/phpsysinfo/phpFile.php: line 2: `require("dbconnect.php");
thanks