The first line needs to be the location of your PHP executable on the machine. You can determine this by typing "which php" on the command line. Assuming you have PHP compiled as CGI, it should return something like /usr/local/bin/php.
I use #!/usr/local/bin/php -q on most of my machines.. The -q suppresses the html garbage. Other than that, it should run.
KABOOM wrote:
Ok, so here's what my test file looks like. I've added that first line but i'm not sure if that's right.
#!/var/www/html/ <----NEW LINE ADDED
<?PHP
$today = getdate();
$year = $today['year'];
print "The year is $year";
if($year == 2001)
{
print "Year is equivalent. Email sent";
$to = "mjyuen@hotmail.com";
$subject = "Test of crontab";
$message = "If your receiving this, crontab test was successful";
mail($to, $subject, $message)
or print ("ERROR: crontab test failed");
}
else
print "Year is not equivalent";
?>