2017-04-20 63 views
-1

我試圖在我的本地安裝的Moodle,但是當我到達安裝系統頁面不告訴我任何事情,當我打開我讀這Moodle的安裝問題

VM457指數瀏覽器的控制檯?.PHP緩存= 0 & agreelicense = 1個& confirmrelease = 1 & LANG = EN:1 GET http://localhost/moodle/admin/index.php?cache=0&agreelicense=1&confirmrelease=1&lang=en網:: ERR_INCOMPLETE_CHUNKED_ENCODING

我重新加載頁面我得到Moodle的配置頁面後,卻沒有任何的風格和很多404請求,我不知道w HY,因爲像數據庫配置的安裝目錄的第一步驟,它表明完美

affter,我不能做任何事......

我使用LEMP和PHP 7.1我配置php.ini文件顯示錯誤,但它不會顯示任何東西,我克隆了git倉庫的moodle,並將其改爲3.2穩定,如果有人知道如何通過這個錯誤,我將非常感激。

Image

回答

0

我最近遇到了類似的問題,這(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

+0

對於遲到的回覆感到抱歉,我確實嘗試過,但它不起作用,我在其他帖子中看到它。 –

0

我終於使它的工作,我測試它在虛擬機上:

nginx的版本:nginx的/ 1.10.0 PHP 7.1.6 的MySQL版本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/
} 

情緒的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文件。或者www.conf的php。

這裏就是我得到的信息的頁面:

配置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