【发布时间】:2017-07-13 08:47:23
【问题描述】:
我在尝试将在 apache 上运行的项目转换为 nginx 时遇到了一些问题。我的其余设置似乎没问题,因为 index.php 正在运行,但是当它到达 WURFL 目录时出错,我将在一分钟内显示。
有人有这方面的经验吗?我在 SO 上找不到任何类似的例子,或者通过常规的谷歌搜索能够帮助我。
nginx.conf
worker_processes 1;
error_log /usr/local/var/log/nginx/nginx_error.log warn;
events {
worker_connections 256;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
wurfl_enable on;
wurfl_root /Library/WebServer/Documents/WURFL/;
keepalive_timeout 65;
server {
listen 80;
server_name localhost;
location / {
root html;
index index.html index.htm;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
include servers/*;
}
服务器/宾果游戏
server {
listen 80;
server_name jock.bingo;
root /Library/WebServer/Documents/superfreebingo.com;
index index.php;
access_log /usr/local/var/log/nginx/testaccess.log;
error_log /usr/local/var/log/nginx/testerror.log;
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass localhost:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param APP_ENV /Library/WebServer/Documents/WURFL;
fastcgi_param wurfl_dir "/Library/WebServer/Documents/WURFL/";
fastcgi_param wurfl_resource_dir "/Library/WebServer/Documents/WURFL/examples/";
}
}
我的错误信息
致命错误:带有消息的未捕获异常“WURFL_Storage_Exception” '文件存储目录不可写: /Library/WebServer/Documents/WURFL/examples/resources/storage/persistence/wurfl_1711' 在 /Library/WebServer/Documents/WURFL/WURFL/Storage/File.php:59 堆栈中 跟踪:#0 /Library/WebServer/Documents/WURFL/WURFL/Storage/File.php(47): WURFL_Storage_File->createRootDirIfNotExist() #1 /Library/WebServer/Documents/WURFL/WURFL/Storage/File.php(39): WURFL_Storage_File->初始化(数组)#2 /Library/WebServer/Documents/WURFL/WURFL/Storage/Factory.php(42): WURFL_Storage_File->__construct(Array) #3 /Library/WebServer/Documents/WURFL/WURFL/WURFLManagerFactory.php(60): WURFL_Storage_Factory::create(Array) #4 /Library/WebServer/Documents/superfreebingo.com/wp-device-redirect.php(46): WURFL_WURFLManagerFactory->__construct(Object(WURFL_Configuration_InMemoryConfig))
5 /Library/WebServer/Documents/superfreebingo.com/wp-subid.php(47): getDevice() #6
/Library/WebServer/Documents/superfreebingo.com/index.php(19): 要求('/图书馆在 /Library/WebServer/Documents/WURFL/WURFL/Storage/File.php 第 59 行
【问题讨论】: