I'm using the Kohana framework (3.0.9), which generates daily logs. I want to mail the log file if one was made the day before CRON runs the script, but after days trying I can't figure out how to put off safe_mode in PHP CLI modus.
When I'm running my script on the web, there is no problem. But I want to run the script as a CRON task on my Plesk 9.5.2 server (or on the command line as root user) I'm getting the following error:
ErrorException [ 2 ]: dir(): SAFE MODE Restriction in effect. The script whose uid is 10001 is not allowed to access /var/www/vhosts/mydomain.com/subdomains/mysubdomain/httpdocs/application/logs/2011/01 owned by uid 48 ~ APPPATH/classes/controller/ajax.php [ 181 ]
I've allready put SAFE MODE off in my Plesk control panel, which works fine for the web request, but not in on the command line or as an CRON task.
I'm using the following code to test if its working:
$d = dir(APPPATH.'logs/2011/01/');
echo "Handle: " . $d->handle . "\n";
echo "Path: " . $d->path . "\n";
while (false !== ($entry = $d->read())) {
echo $entry."\n";
}
$d->close();
I can read the directory APPPATH.'logs/', and also the directory APPPATH.'logs/2011', but the directory's representing each month with the daily log files always give an error.