Hi Folks,
I'm trying to call a php script via cron:
so I edit the crontab and add (for example)
#Test
10 12 26 2 * /usr/bin/php /var/www/html/intranet/tools/updateCIRenewalDates.php
and the PHP file:
<?php
define("LIBPATH", "/export/Library/");
include( LIBPATH . "db.inc");
$insert = "";
$connection = @ mysql_connect($hostName, $username, $password) or die("Cannot connect");
mysql_select_db("mydb", $connection) or die(mysql_error());
$insert = mysql_query("BEGIN;", $connection);
$query = "select * from Domain where D_Name = 'robtest.ie'";
$result = mysql_query ($query, $connection);
if(!$result){
echo "Some text to be emailed by Cron if there's an error.\n";
}
else{
echo "A Success Message.\n";
}
$insert = mysql_query("COMMIT;", $connection);
mysql_close($connection);
?>
However when I test it by running the script directly from the command line:
/usr/bin/php /var/www/html/intranet/tools/updateCIRenewalDates.php
I get the horrible:
PHP Warning: Cannot open 'extra/browscap.ini' for reading in Unknown on line 0
Content-type: text/html
But the correct value prints to the screen - that the select went ok
.
So why would the script be looking for this file(which don't exist) when I don't refer to it anywhere?
I'm running this on a red hat box, and am using php 4.
thanks!
Robin.