Mik*_*ike 2 php moodle nginx homestead
我已经安装了Homestead VM并在我的Mac(OSX Yosemite)上设置了Moodle安装文件夹.我还创建了'moodledata'文件夹并通过我的系统命令行给它权限0777以及文件夹'moodledata/sessions'(我尝试通过VM内的SSH进行此操作,但它似乎没有更改权限) .但是,通过我的系统执行此操作后检查权限显示该文件夹可从VM内部写入.
然后我转到安装过程并创建了数据库表并进行了检查,显示了2个检查警告:Intl和xmlrpc来检查
我不认为这些对于初始安装是必不可少的.当我到达管理员用户创建我遇到问题时.该页面(/user/editadvanced.php?id=2)停止加载任何图像,当我张贴的形式我得到一个错误:"不正确提交sesskey,形式不接受" 我认为这可以归结为在moodledata文件夹中不可写的会话但是因为我已经检查过现在我的想法!
我附上了几个截图.
非常感谢,迈克.
好几天头疼后我通过编辑NGINX配置文件解决了我自己的问题.以下是默认情况:
server {
listen 80;
server_name example.com;
root /home/forge/example.com;
# FORGE SSL (DO NOT REMOVE!)
# ssl_certificate;
# ssl_certificate_key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
index index.html index.htm index.php;
charset utf-8;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
access_log off;
error_log /var/log/nginx/example.com-error.log error;
error_page 404 /index.php;
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
location ~ /\.ht {
deny all;
}
}
Run Code Online (Sandbox Code Playgroud)
这就是我改变它的方式,它现在有效:
server {
listen 80;
server_name example.com; #REPLACE SERVER NAME
root /var/www/example.com/www/; #REPLACE MOODLE INSTALL PATH
error_log /var/www/example.com/log/example.com_errors.log; #REPLACE MOODLE ERROR LOG PATH
access_log /var/www/example.com/log/example.com_access.log; #REPLACE MOODLE ACCESS LOG PATH
rewrite ^/(.*\.php)(/)(.*)$ /$1?file=/$3 last;
location / {
index index.php index.html index.htm;
try_files $uri $uri/ /index.php;
}
fastcgi_intercept_errors on;
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
location ~ /\.ht {
deny all;
}
}
Run Code Online (Sandbox Code Playgroud)
我没有时间看看上面配置的哪个部分/部分修复了这个问题,也许知道的人可以马上看到?我怀疑它可能是重写规则?无论哪种方式,我希望这将有助于将来的其他人,我很高兴让这个工作!
| 归档时间: |
|
| 查看次数: |
661 次 |
| 最近记录: |