Question

Hi i've been getting error email from moodle backup, then i tried to do it manually from comand line and i got this 2 errors:

http://imageshack.com/a/img838/3534/yc5n.png

i checked the line of the code that is 'chdir(dirname($_SERVER['argv'][0]));' inside the next if:

    if (!isset($_SERVER['REMOTE_ADDR']) && isset($_SERVER['argv'][0])) {
        // do it only once - skip the second time when continuing after prevous abort
        if (!defined('ABORT_AFTER_CONFIG') and !defined('ABORT_AFTER_CONFIG_CANCEL')) {
           chdir(dirname($_SERVER['argv'][0]));
        }
    }

checked server argv in php.ini but it is activated, so i don't know what could be happening.

and for the next error in spanish 'url no valida' = 'Invalid URL'.

http://imageshack.com/a/img844/4109/gqia.png

i don't know if it is related to the first one or if it is about the url of the course, please need help with this.

EDIT: Moodle version 2.5.1 (Build: 20130708)

Was it helpful?

Solution

Those lines are in the setup.php file which is called at the end of the config.php. So its not related specifically to the backup.

I'm guessing the error is because its being called from the command line rather than from Apache.

In config.php how do you set the values for

$CFG->wwwroot = '';
$CFG->dirroot = '';

If you use something like

$CFG->wwwroot   = 'http://' . $_SERVER['HTTP_HOST'];

Then it won't work because its called from the command line - so replace it with the literal value eg:

$CFG->wwwroot = 'http://www.yourwebsite.com';

and the same for dirroot and dataroot - use literal values instead of functions.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top