【问题标题】:Moodle Installation problemsMoodle 安装问题
【发布时间】:2017-06-27 00:14:46
【问题描述】:

我正在尝试在我的本地主机上安装moodle,但是当我到达安装系统页面时,它没有显示任何内容,当我打开浏览器的控制台时,我读到了这个

VM457 index.php?cache=0&agreelicense=1&confirmrelease=1&lang=en:1 GET http://localhost/moodle/admin/index.php?cache=0&agreelicense=1&confirmrelease=1&lang=en net::ERR_INCOMPLETE_CHUNKED_ENCODING

重新加载页面后,我得到moodle配置页面,但没有任何样式和大量404请求,我不知道为什么,因为安装的第一步就像数据库配置一样完美显示

因为我什么都做不了……

我正在使用 lemp 和 php 7.1 我配置 php.ini 文件以显示错误但它没有显示任何内容,我克隆 git 存储库的 moodle 并将 brach 更改为 3.2 stable,如果有人知道如何传递给这个错误我将不胜感激。

Image

【问题讨论】:

    标签: nginx moodle


    【解决方案1】:

    我最近遇到了类似的问题,这 (ERR_INCOMPLETE_CHUNKED_ENCODING) 可能是由于 gzip 压缩可能没有启用或配置正确。该错误与编码有关。我在这里回答了非常相似的问题。

    找到你的 php.ini 文件,转到 php.ini 文件

    sudo vi /etc/php/5.6/apache2/php.ini
    

    添加或设置低于 2 行

    zlib.output_compression = on
    zlib.output_compression_level = 6
    

    重启apache

    sudo service apache2 restart
    

    它将开始正常工作。

    moodle not showing CSS and theme with linux server

    【讨论】:

    • 抱歉回复晚了,我试过了,没用,我在其他帖子里看到的。
    【解决方案2】:

    我终于让它工作了,我在虚拟机上测试它:

    nginx版本:nginx/1.10.0 PHP 7.1.6 mysql Ver 14.14 Distrib 5.7.18

    在 nginx 默认文件中添加:

    location ~ [^/]\.php(/|$) {
        fastcgi_split_path_info  ^(.+\.php)(/.+)$;
        fastcgi_index            index.php;
        fastcgi_pass             unix:/var/run/php/php7.1-fpm.sock;
        include                  fastcgi_params;
        fastcgi_param   PATH_INFO       $fastcgi_path_info;
        fastcgi_param   SCRIPT_FILENAME $document_root$fastcgi_script_name;
    }
    
    location /dataroot/ {
        internal;
        alias /var/www/moodledata/; # ensure the path ends with /
    }
    

    在moodle的config.php文件中我添加了这个:

    $CFG->xsendfile = 'X-Accel-Redirect';
    $CFG->xsendfilealiases = array(
        '/dataroot/' => $CFG->dataroot
    );
    

    这是我的默认 nginx 文件的样子:

    服务器块:

    server {
        listen 80 default_server;
        listen [::]:80 default_server;
    
        root /var/www/html;
    
        # Add index.php to the list if you are using PHP
        index index.php index.html index.htm index.nginx-debian.html;
    
        server_name _;
    
        location ~ [^/]\.php(/|$) {
            fastcgi_split_path_info  ^(.+\.php)(/.+)$;
            fastcgi_index            index.php;
            fastcgi_pass             unix:/var/run/php/php7.1-fpm.sock;
            include                  fastcgi_params;
            fastcgi_param   PATH_INFO       $fastcgi_path_info;
            fastcgi_param   SCRIPT_FILENAME 
            $document_root$fastcgi_script_name;
        }
    
        location /dataroot/ {
            internal;
            alias /var/www/moodledata/; # ensure the path ends with /
        }
    
        try_files $uri $uri/ /index.php?args;
    }
    

    这是moodle config.php 文件:

    <?php
    
    unset($CFG);  // Ignore this line
    global $CFG;  // This is necessary here for PHPUnit execution
    $CFG = new stdClass();
    
    $CFG->dbtype    = 'mysqli';
    $CFG->dblibrary = 'native';
    $CFG->dbhost    = 'localhost';
    $CFG->dbname    = 'moodle';
    $CFG->dbuser    = 'dbusername';
    $CFG->dbpass    = 'dbpassword';
    $CFG->prefix    = 'mdl_';
    $CFG->dboptions = array(
        'dbpersist' => 0,
        'dbsocket'  => '',
        'dbport'    => 3306,
        'dbhandlesoptions' => false,
        'dbcollation' => 'utf8mb4_general_ci', 
    );
    
    $CFG->wwwroot   = 'http://localhost/moodle';
    
    $CFG->dataroot  = '/var/www/moodledata';
    
    $CFG->directorypermissions = 0777;
    
    $CFG->admin = 'admin';
    
    $CFG->xsendfile = 'X-Accel-Redirect';
    $CFG->xsendfilealiases = array(
        '/dataroot/' => $CFG->dataroot
    );
    
    require_once(__DIR__ . '/lib/setup.php'); // Do not edit
    

    我没有修改 php.ini 文件。或者php的www.conf。

    这是我获取信息的页面:

    配置nginx和moodles config.php文件: https://docs.moodle.org/33/en/Nginx#XSendfile_aka_X-Accel-Redirect

    安装 PHP 时,我建议安装这些模块:

    sudo apt-get install php7.1-fpm php7.1-mysql php7.1-common php7.1-cgi php7.1-curl php7.1-cli php7.1-dev php7.1-gd php7.1-gmp php7.1-xml php7.1-xmlrpc php7.1-zip php7.1-xls php7.1-opcache php7.1-mbstring php7.1-soap php7.1-intl graphviz aspell php7.1-pspell php7.1-ldap
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-06-12
      • 1970-01-01
      • 2017-03-09
      • 1970-01-01
      • 1970-01-01
      • 2013-03-10
      • 1970-01-01
      相关资源
      最近更新 更多