0

Noticed in our error_log file is showing this below

[09-Feb-2016 16:55:02 UTC] PHP Notice:  Undefined index: SCRIPT_NAME in /home/USERNAME/public_html/cron.php on line 40
[09-Feb-2016 16:55:02 UTC] PHP Notice:  Undefined index: SCRIPT_FILENAME in /home/USERNAME/public_html/cron.php on line 41

on line 40 and 41 of the cron.php is this

$_SERVER['SCRIPT_NAME'] = str_replace(basename(__FILE__), 'index.php', $_SERVER['SCRIPT_NAME']);
$_SERVER['SCRIPT_FILENAME'] = str_replace(basename(__FILE__), 'index.php', $_SERVER['SCRIPT_FILENAME']);

anyone any ideas why its not running ?

  • What is the output of crontab -l ? Perhaps you are using the wrong binary for php. – Christian Feb 10 '16 at 0:59
  • Output of the cron is this below running every minute php -q /home/USERNAME/public_html/cron.php – Marc Smith Feb 10 '16 at 8:04
1

You'd mind $_SERVER variables are different if you run php in a web request or as a command line script (as your case)

Running php as command line script both variables should exist, unless you are running php-cgi. You should add print_r($_SERVER);exit; in cron.php file to see what's happening, and then hardcode that variables, if needed

More info here https://github.com/owncloud/core/issues/11551

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.