Installation error

Installation error

by Rudy Setiawan -
Number of replies: 5

Current Moodle version: 3.8
OS: Ubuntu
PHP: 7.2-fpm
Browser: Chrome

after all the system is initialized or installed, the 2nd step of the installation was adding the user but apparently, the theme is not displaying correctly. the 1st step of the installation (database, directories configuration page) was fine.

After the system is initialized or configured, saw the nginx error_log:

2019/11/24 14:24:38 [error] 13378#13378: *118 FastCGI sent in stderr: "PHP message: Cannot find session record mb7fvadodk8j87osjo8smgo521 for user 2, creating new session" while reading response header from upstream, client: 13.12.98.6, server: host.domain.com, request: "GET /lib/javascript.php/1574605433/lib/mdn-polyfills/polyfill.js HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.2-fpm.sock:", host: "host.domain.com", referrer: "https://host.domain.com/user/editadvanced.php?id=2"

I have also attached the Chrome Console error and the look of the step2 on the browser.

Help me outt

Attachment moodle-2ndstep.png
Attachment moodle-install-error.png
Average of ratings: -
In reply to Rudy Setiawan

Re: Installation error

by Ken Task -
Picture of Particularly helpful Moodlers

Go to 'plan B'! ;)

ssh into server. cd /path/to/moodle/code/admin/cli/

Then do the install using CLI script in above directory.

php install.php [ENTER]

You will be prompted to provide same info as web based install for the initial admin user password.

Takes apache service out of the loop.

'SoS', Ken


In reply to Rudy Setiawan

Re: Installation error

by Diógenes Konrad Götz -

I know that it's a old thread, but I can help another persons with this same problem in the future.

The problem was, that you miss a nginx configuration on virtual host section.
https://docs.moodle.org/38/en/Nginx

location ~ ^(.+\.php)(.*)$ {
    root /usr/share/nginx/html/moodle/;
    fastcgi_split_path_info ^(.+\.php)(.*)$;
    fastcgi_index index.php;
    fastcgi_pass 127.0.0.1:9000;
    include /etc/nginx/mime.types;
    include fastcgi_params;
    fastcgi_param PATH_INFO $fastcgi_path_info;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}

In reply to Diógenes Konrad Götz

Re: Installation error

by Vito Corleone -
Sorry for possible a very dumb question but where exactly do you have to write that piece of code?

I’m installing an 3.9 moodle in a Ubuntu Server (18.04) and the same happens. All seems all right but right after the installation the same happens and it wasn’t possible to continue any further.

I have two options:
- /etc/nginx/nginx.conf
- /etc/nginx/sites-available/mysite.com

we were trying to put it at the end of /etc/nginx/nginx.conf but when we check in the terminal with

sudo nginx -t

there appears another error (but maybe there was necessary to put it in another part of the file)

By the way the terms mentioned in the code

PATH_INFO
SCRIPT_FILENAME

I added them manually into /etc/nginx/fastcgi_params

That would be.


Thanks a lot!!!
In reply to Rudy Setiawan

Re: Installation error

by Vito Corleone -
I could solve the issue by following these tutorials.


https://musaamin.web.id/cara-install-moodle-dengan-nginx-di-ubuntu-18-04/

(He speaks in a strange language, but it is still possible to understand the steps)
Though, I did it slightly differently, I created before a different linux user to perform the install, besides I use mysql , not mariadb as he does. The difference is how he sets nginx.


Before try this I got the same error by following these tutorials
https://www.digitalocean.com/community/tutorials/como-instalar-linux-nginx-mysql-php-pila-lemp-en-ubuntu-18-04-es

which uses a different setting for nginx.

Hope it works!

Have nice days
In reply to Rudy Setiawan

Re: Installation error

by Vito Corleone -
A final note:
in the location part of the file I finally have to use


location ~ [^/]\.php(/|$) {
proxy_read_timeout 3600;
fastcgi_read_timeout 240;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_index index.php;
fastcgi_pass unix:/run/php/php7.2-fpm.sock;
include fastcgi_params;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}


The lines:

proxy_read_timeout 3600;
fastcgi_read_timeout 240;


Have to added due to some errors regarding the sending of emails but don’t know if they are actually necessary.


Also

in the file /etc/php/7.2/fpm/php.ini

I used

cgi.fix_pathinfo=1


If you have problems regarding the email sending you can see:

https://blog.ashwinshenoy.com/php-send-mail-very-slow-9b0a4ace6672

That is
Average of ratings: Useful (1)