I use the Kohana structure (3.0.9), which generates daily logs. I want to send a log file if it was made a day before CRON runs the script, but after several days of trying, I can’t figure out how to defer safe_mode in PHP CLI modus.
When I run my script on the Internet, 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 get the following error:
ErrorException [2]: dir (): SAFE MODE Effective. script that uid 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 already disabled SAFE MODE in the Plesk control panel, which works fine for a web request, but is not part of the command line or the CRON task.
I use the following code to check if it works:
$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 APPPATH.'logs / 'directory, as well as the APPPATH.'logs / 2011' directory, but the directory representing every month with daily log files always gives an error.
source
share