我正在尝试安装moodle,但是当我指定moodle数据文件夹的路径时,我遇到了一个错误。基本上,他们希望它位于无法从网络访问的地方。
我试过把它放在/var/moodledata
里面给我一个错误的说法
Parent directory (/var) is not writeable. Data directory (/var/moodledata) cannot be created by the installer.
,/var/www/moodledata
并且给我一个错误的说法Dataroot location is not secure
我尝试将 sudo(permissions) 赋予该/var/www/
文件夹,并尝试install.php
通过注释以下行来跳过验证
/*while(is_dataroot_insecure()) {
$parrent = dirname($CFG->dataroot);
$i++;
if ($parrent == '/' or $parrent == '.' or preg_match('/^[a-z]:\\\?$/i', $parrent) or ($i > 100)) {
$CFG->dataroot = ''; //can not find secure location for dataroot
break;
}
$CFG->dataroot = dirname($parrent).'/moodledata';
}*/
和
/* do {
if ($CFG->dataroot !== '') {
$prompt = get_string('clitypevaluedefault', 'admin', $CFG->dataroot);
} else {
$prompt = get_string('clitypevalue', 'admin');
}
echo $error;
$CFG->dataroot = cli_input($prompt, $CFG->dataroot);
if ($CFG->dataroot === '') {
$error = get_string('cliincorrectvalueretry', 'admin')."\n";
} else if (is_dataroot_insecure()) {
$CFG->dataroot = '';
$error = get_string('pathsunsecuredataroot', 'install')."\n";
} else {
if (install_init_dataroot($CFG->dataroot, $CFG->directorypermissions)) {
$error = '';
} else {
$a = (object)array('dataroot' => $CFG->dataroot);
$error = get_string('pathserrcreatedataroot', 'install', $a)."\n";
cli_error(get_string('pathsunsecuredataroot', 'install'));
}
}
} while ($error !== '');*/
} /*else {
if (is_dataroot_insecure()) {
}
if (!install_init_dataroot($CFG->dataroot, $CFG->directorypermissions)) {
$a = (object)array('dataroot' => $CFG->dataroot);
cli_error(get_string('pathserrcreatedataroot', 'install', $a));
}
}*/
但是,我还没有成功。任何关于我如何克服这个问题的想法都将不胜感激!