我遇到了一些问题,试图将运行在apache上的项目转换为nginx。我设置的其余部分似乎还不错,因为index.php正在运行,但是当它到达WURFL目录时出错,我将立即显示该目录。
有人有这样做的经验吗?我没有找到任何类似的例子,所以,或通过定期谷歌搜索,能够帮助我。
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/WURFL/Storage/File.php:59堆栈跟踪中的/Library/WebServer/Documents/WURFL/WURFL/Storage/File.php(47)::#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_ /Library/WebServer/Documents/WURFL/WURFL/WURFLManagerFactory.php(60):_File->初始化(数组) #2 /Library/WebServer/Documents/WURFL/WURFL/WURFLManagerFactory.php(60):_Storage_ /Library/WebServer/Documents/superfreebingo.com/wp-device-redirect.php(46):WURFL_WURFLManagerFactory->__construct(Object(WURFL_Configuration_InMemoryConfig)) ->__/Library/WebServer/Documents/superfreebingo.com/wp-device-redirect.php(46):WURFL_WURFLManagerFactory->__construct(Object(WURFL_Configuration_InMemoryConfig))(数组) #3 WURFL_Storage_Factory::create(数组) #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):要求(第59行/Library/WebServer/Documents/WURFL/WURFL/Storage/File.php中的‘/Libr)
发布于 2017-07-13 09:16:19
目前还没有人给出答案,但实际上我找到了解决方案,而不是删除这个问题,而是把我为解决这个问题所做的事情发了出去,供将来的任何开发人员使用这个问题。
只是文件权限问题。我导航到WURFL目录指定的位置:
/Library/WebServer/Documents/WURFL/examples/resources/storage/persistence
然后运行递归文件权限编辑:
sudo chmod -R 666 wurfl_1711
在那之后,我重新加载了这个站点,它给了另一个文件夹同样的错误,所以我导航到那个文件夹,然后再做一次。
希望这能帮到别人!
https://stackoverflow.com/questions/45075699
复制相似问题