I am trying to install Moodle and everything seems fine but then when it comes to Admin user creation process, it seems as there is no CSS file, and "update profile" button does not perform any action. So I am stuck on page moodle/user/editadvanced.php?id=2

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, and owner of that directory. But it remains the same after every installation.

I have already searched for this problem but couldn't find a solution. I am following a tutorial on HowToForge to install Moodle.

Screenshot

My moodle data location: /var/moodledata

My Moodle dir: /var/www/career/moodle/

My Nginx config file:

    server {
    listen 80;
    listen   443 ssl spdy;
    server_name  domain.com;
    keepalive_timeout    70;
    root   /var/www/domain;

    #ssl  on;
    gzip    on;
    ssl_certificate  /etc/letsencrypt/live/domain.com/fullchain.pem; # managed by Certbot
    ssl_certificate_key  /etc/letsencrypt/live/domain.com/privkey.pem; # managed by Certbot
    ssl_protocols   TLSv1.2;
    ssl_ciphers     EECDH+AESGCM:EDH+AESGCM:ECDHE-RSA-AES128-GCM-SHA256:AES256+EECDH:DHE-RSA-AES128-GCM-SHA256:AES256+EDH:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA:ECDHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES128-SHA256:DHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES256-GCM-SHA384:AES128-GCM-SHA256:AES256-SHA256:AES128-SHA256:AES256-SHA:AES128-SHA:DES-CBC3-SHA:HIGH:!aNULL:!eNULL:!EXPORT:!DES:!MD5:!PSK:!RC4:!3DES;
    ssl_dhparam     /etc/nginx/conf.d/dhparam.pem;
    ssl_prefer_server_ciphers   on;
    ssl_session_tickets     off;
    ssl_session_cache       shared:SSL:10m;

          add_header   Strict-Transport-Security "max-age=63072000; includeSubdomains; ";
    add_header   X-Frame-Options "DENY";
    spdy_headers_comp 6;
    spdy_keepalive_timeout 300;

    access_log  /var/log/nginx/career.access.log;
    error_log   /var/log/nginx/career.error.log;

    location / {
            root   /var/www/career;
            #try_files $uri $uri/ = /404.html;
            if ($request_uri ~ ^/(.*)\.html$) {  return 302 /$1;  }
            try_files $uri $uri/ $uri.html $uri.php?$args;
            index  index.php index.html;
            add_header   Strict-Transport-Security "max-age=63072000; includeSubdomains" always;
    }

    error_page  404  /404.html;
    location = /404.html {
            root    /var/www/career;
            internal;
    }

    error_page  405  /405.html;
    # redirect server error pages to the static page /50x.html
    #
    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
            root   /var/www/career;
    }

    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
    #
    location ~* \.php$ {
            root           /var/www/career;
            #fastcgi_pass   127.0.0.1:9000;
            fastcgi_pass php-fpm;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME         $document_root$fastcgi_script_name;
            include  fastcgi_params;
            #if ($request_uri ~ ^/([^?]*)\.php($|\?)) {  return 302 /$1;  }
            try_files $uri = 404;
            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;

    }

    # deny access to .htaccess files, if Apache's document root
    # concurs with nginx's one
    #
    location ~ /\.ht {
            deny  all;
    }

    }

Moodle version tried: 3.5.1 and 3.2.9

Database creation steps:

  1. CREATE DATABASE DATABASENAME DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

  2. GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,CREATE TEMPORARY TABLES,DROP,INDEX,ALTER ON DATABASENAME.* TO 'DB_USER'@'localhost' IDENTIFIED BY 'PASSWORD';

Mysql Version: 5.5.56-MariaDB MariaDB Server

I personally think its permission issues, for some reason maybe Moodle is not able to access the files or install it. But even though I gave it 777 permission to both moodledata dir and moodle dir.

UPDATE

I see some files are not loaded and missing as shown in the image below.

JavaScript Files Error in Log

PHP File Error in Resources

up vote 0 down vote accepted

I replaced the location .php in nginx.conf file and now it works perfectly fine. and now the slash argument works fine.

new location:

location ~ [^/]\.php(/|$) {
    fastcgi_split_path_info  ^(.+\.php)(/.+)$;
    fastcgi_index            index.php;
    fastcgi_pass             php-fpm; (or 127.0.0.1:9000)
    include                  fastcgi_params;
    fastcgi_param   PATH_INFO       $fastcgi_path_info;
    fastcgi_param   SCRIPT_FILENAME $document_root$fastcgi_script_name;
}

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.