我正在尝试安装Moodle,一切看起来都很好,但是当涉及到管理用户创建过程时,它似乎没有CSS文件,并且"update profile“按钮不执行任何操作。所以我被困在moodle/user/editadvanced.php?id=2页面上了
我也附上了网站的截图。
我已经尝试了所有可能的方法,例如将权限更改为777,或者使用根用户、Nginx用户和该目录的所有者。但每次安装后都保持原样。
我已经找过这个问题了,但没有找到解决办法。我正在学习一个关于HowToForge的教程来安装Moodle。
My moodle数据位置: /var/moodledata
My Moodle dir: /var/www/career/moodle/
My Nginx配置文件:
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版本: 3.5.1和3.2.9
Database创建步骤:
CREATE DATABASE DATABASENAME DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,CREATE TEMPORARY TABLES,DROP,INDEX,ALTER ON DATABASENAME.* TO 'DB_USER'@'localhost' IDENTIFIED BY 'PASSWORD';Mysql版本: 5.5.56-MariaDB MariaDB Server
我个人认为它的权限问题,因为某些原因,也许Moodle无法访问或安装文件。但是,即使我给了它777的权限,moodledata dir和moodle dir。
<#>更新
我看到一些文件没有加载和丢失,如下图所示。
发布于 2018-08-14 08:03:14
我在nginx.conf文件中替换了nginx.conf,现在它运行得非常好。现在,斜杠的论点起作用了。
新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;
}https://serverfault.com/questions/925791
复制相似问题