【问题标题】:Converting Apache WP to Nginx with WURFL使用 WURFL 将 Apache WP 转换为 Nginx
【发布时间】: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 行

【问题讨论】:

    标签: php wordpress nginx wurfl


    【解决方案1】:

    还没有人回答,但我实际上找到了解决方案,而不是删除问题,我认为我会发布我为解决它所做的工作,以供未来遇到此问题的开发人员使用。

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

    /Library/WebServer/Documents/WURFL/examples/resources/storage/persistence

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

    sudo chmod -R 666 wurfl_1711

    之后,我重新加载了网站,但它对不同的文件夹给出了相同的错误,所以我导航到那个文件夹并再次这样做。

    希望这对某人有所帮助!

    【讨论】:

      猜你喜欢
      • 2014-10-31
      • 2014-09-24
      • 2015-05-21
      • 2011-11-25
      • 2012-07-19
      • 2021-11-26
      • 2021-12-28
      • 2011-05-19
      • 1970-01-01
      相关资源
      最近更新 更多