config.php-cron

config.php-cron

by ivan breziansky -
Number of replies: 2
Hi,

i setup the cron as per instruction from moodle site. add it to schedule job, but when i try to run it, im getting following error: "PHP Notice: Undefined index: SERVER_NAME in c:\moodle\config.php on line 13" in config.php.
The story behind this is, that we needed to change the path, so we can access moodle from internet as well. So, we added code to config file- see attachment, and it does work. But the cron somehow doesnt like it. Please let me know if there is a way to fix it.. either altering the code or changing the way cron runs.

Thank you


Average of ratings: -
In reply to ivan breziansky

Re: config.php-cron

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
we needed to change the path, so we can access moodle from internet as well

That was almost certainly the wrong thing to do. The only sensible way to have access from diverse IP ranges is to have internal and external DNS servers point the *same* url to the different IP addresses.

Doing what I suspect you have done in config.php is both insecure and causes problems like this.
In reply to Howard Miller

Re: config.php-cron

by ivan breziansky -
Hi,

thank you for your reply. Can you please be a little more specific as of how to set it up..? I spoke with our local IT and they couldnt understand from your sentence what exactly needs to be done.
Thank you.