Moodle Stuck at Installation while adding Admin User

Moodle Stuck at Installation while adding Admin User

by James Anderson -
Number of replies: 9

Hi,

I am trying to install Moodle and everything seems fine but then when it comes to Admin user, it seems as there is no CSS file, and "update profile" button does not perform any action.

I have also attached the screenshot of the website.

I have already tried every possible way I could such as changing permission to 777, or with root user, Nginx user etc. But it remains the same after every installation.


I have followed installation procedures from Moodle's docs, howtoforge, digital ocean but this problem persists.

Moodle Error

Average of ratings: Useful (1)
In reply to James Anderson

Re: Moodle Stuck at Installation while adding Admin User

by Conn Warwicker -
Picture of Core developers Picture of Plugin developers

Try deleting everything in the cachedir and localcachedir inside your moodledata folder.

In reply to Conn Warwicker

Re: Moodle Stuck at Installation while adding Admin User

by James Anderson -
Hi,


I tried that as well, but it remains the same with broken CSS/PHP files. 

In reply to James Anderson

Re: Moodle Stuck at Installation while adding Admin User

by Conn Warwicker -
Picture of Core developers Picture of Plugin developers

Have you got debugging turned on, to see if there is an error somewhere? Checked your server logs as well?

In reply to Conn Warwicker

Re: Moodle Stuck at Installation while adding Admin User

by James Anderson -

Hi,


Yes, I did check the server logs, seems fine, but I don't think if I turned on the debugging mode. I posted this question on StackOverflow with more details and logs etc here. 


https://serverfault.com/questions/925791/moodle-error-during-installation

In reply to James Anderson

Re: Moodle Stuck at Installation while adding Admin User

by AL Rachels -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

Possible problem with the / in location in you Nginx config file.

location ~* \.php$ {
This one works for me:

# pass PHP scripts to FastCGI server
#
location ~ [^/]\.php(/|$) {
include snippets/fastcgi-php.conf;

# With php-fpm (or other unix sockets):
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
# # With php-cgi (or other tcp sockets):
# fastcgi_pass 127.0.0.1:9000;
}

In reply to AL Rachels

Re: Moodle Stuck at Installation while adding Admin User

by James Anderson -
Did change the Nginx config to below, but still same issue. Initial installation's css is working fine but when it comes to Admin step, at that time the files are broken as shown in the image above.


location ~ [^/]\.php(/|$) {

                root           /var/www/moodle;

                #fastcgi_pass   127.0.0.1:9000;

                fastcgi_pass php-fpm;

                fastcgi_index  index.php;

                fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;

                fastcgi_param   PATH_INFO       $fastcgi_path_info;

                include  fastcgi_params;

                #if ($request_uri ~ ^/([^?]*)\.php($|\?)) {  return 302 /$1;  }

                try_files $uri = /404.html;

                fastcgi_split_path_info  ^(.+\.php)(/.+)$;

                fastcgi_param QUERY_STRING  $query_string;

                fastcgi_param REQUEST_METHOD  $request_method;

                fastcgi_param CONTENT_TYPE  $content_type;

                fastcgi_param CONTENT_LENGTH  $content_length;

                fastcgi_intercept_errors  on;

                fastcgi_ignore_client_abort  off;

                fastcgi_connect_timeout  60;

                fastcgi_send_timeout  180;

                fastcgi_read_timeout  180;

                fastcgi_buffers 256  16k;

                fastcgi_buffer_size  32k;

                fastcgi_temp_file_write_size  256k;


        }


        location /dataroot/ {

                internal;

                alias  /var/moodledata/; # ensure the path ends with /

        }


        # deny access to .htaccess files, if Apache's document root

        # concurs with nginx's one

        #

        location ~ /\.ht {

                deny  all;

        }  

In reply to James Anderson

Re: Moodle Stuck at Installation while adding Admin User

by Matteo Scaramuccia -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers

Hi James,
I'm coming here from https://github.com/moodlehq/moodle-docker/issues/88.

Regardless your Moodle instance deployed by means of a container, could you give us a picture of your setup?
From the GitHub issue:

  1. You're running your Moodle instance using nginx on a CentOS
  2. You're running a Reverse Proxy in front of your Moodle instance
  3. Your Reverse Proxy doesn't offload HTTPS since HTTPS is provided directly by the nginx powering your Moodle instance
  4. You're using an external DB Server (not relevant here)

Is the picture above correct?
If yes:

HTH,
Matteo

In reply to Matteo Scaramuccia

Re: Moodle Stuck at Installation while adding Admin User

by James Anderson -

Hi Matteo,


Thanks for replying. My scenario:


  1. Actually, I was trying to install Moodle on Centos 7 with Nginx and Maria DB (on the same server). After trying for several times with every different method and solution available on the internet for like 3-4 days, I decided to maybe try to install it on docker if in case there is an issue with the server as I cannot replace the server itself. At the moment I have not tried Moodle on Docker as the Documentation here (https://github.com/moodlehq/moodle-docker/blob/master/README.md) is too confusing especially when I am new to Docker. I don't see an installation setup in Documentation and also I wanted to install Moodle 3.2.9 so I am not sure how I can do that.
  2. I tried changing the `fastcgi_split_path_info ` and replaced it to the very top but it gives me same broken CSS/PHP files (I tried to install it the server and not on the container as I do not know of it yet).
  3. I tried to totally replace the location with the one with Moodle's Docs and now it works. So can you tell me what was wrong with mine config of Nginx?


location ~ [^/]\.php(/|$) { fastcgi_split_path_info ^(.+\.php)(/.+)$; 

fastcgi_index index.php; fastcgi_pass php-fpm; include fastcgi_params;

fastcgi_param PATH_INFO $fastcgi_path_info; 

fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; }


In reply to James Anderson

Re: Moodle Stuck at Installation while adding Admin User

by Colin Fraser -
Picture of Documentation writers Picture of Testers

James, are you using a Synology NAS? You haven't said it, so this may be way off the mark, but I understand that setup, CentOS and NGinx with the option of MariaDB, is what they use. If so, try downloading the latest DSM update. I had a similar issue with a DSM update and Moodle, or I think that's what it was, and a new DMS update resolved it. Couldn't find the problem, neither Synology forums or Stackoverflow were of any assistance.