使用WURFL将Apache WP转换为Nginx

时间:2017-07-13 08:47:24

标签: php wordpress nginx wurfl

我在尝试将运行在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'   '文件存储目录不可写:   /库/ Web服务器/文档/ WURFL /示例/资源/存储/持久/ wurfl_1711'   in /Library/WebServer/Documents/WURFL/WURFL/Storage/File.php:59 Stack   追踪:#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-> initialize(Array)#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-> __构建体(对象(WURFL_Configuration_InMemoryConfig))

     

5 /Library/WebServer/Documents/superfreebingo.com/wp-subid.php(47):getDevice()#6

     

/Library/WebServer/Documents/superfreebingo.com/index.php(19):   要求('/ Libr in   /Library/WebServer/Documents/WURFL/WURFL/Storage/File.php第59行

1 个答案:

答案 0 :(得分:1)

还没有人回答,但我实际上找到了解决方案,而不是删除我认为我发布了解决问题的问题,而不是删除这个问题的任何未来开发者。

这只是一个文件权限问题。我导航到WURFL目录中指定的位置:

<强> /库/ Web服务器/文档/ WURFL /示例/资源/存储/持久

然后运行递归文件权限编辑:

sudo chmod -R 666 wurfl_1711

之后我重新加载了网站,它为不同的文件夹提供了相同的错误,所以我导航到那个并重新做了。

希望这有助于某人!