-1

i am trying to install moodle on my localhost, but when i reach the installation system page it does not show me anything, when i open the console of the browser i read this

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

after i reload the page i get the moodle config page, but without any style and a lot of 404 request, that i dont know why, because the first steps of the instalation like the database configuration it shows perfectly

affter that i cant do anything...

i am using lemp and php 7.1 i configure php.ini file to display errors but it does not show me anything, i clone moodle of the git repository and change brach to 3.2 stable, if anyone knows how to get pass to this error i would very appreciate it.

Image

2 Answers2

0

I faced similar issue recently, this (ERR_INCOMPLETE_CHUNKED_ENCODING) could be due to gzip compression might not be enabled or configured properly. The error is related to encoding. I replied to very similar problem here.

Locate your php.ini files, Go to php.ini file

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

Add or set below 2 lines

zlib.output_compression = on
zlib.output_compression_level = 6

Restart apache

sudo service apache2 restart

It will start working fine.

moodle not showing CSS and theme with linux server

Bishwanath Jha
  • 399
  • 3
  • 10
0

i finally make it to work, i test it on a virtual machine with:

nginx version: nginx/1.10.0 PHP 7.1.6 mysql Ver 14.14 Distrib 5.7.18

To the nginx default file i add this:

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 /
}

To the config.php file of moodle i added this:

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

This is how my default nginx file looks like:

Server block:

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;
}

And this is the moodle config.php file:

<?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

I did not modified the php.ini file. or the www.conf of php.

Here is the page where i got the info:

To configure nginx and moodles config.php file: https://docs.moodle.org/33/en/Nginx#XSendfile_aka_X-Accel-Redirect

When install PHP i do recomend to install these modules:

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