I'm having some issues trying to convert a project that runs on apache over to nginx. The rest of my set up seems to be fine, because the index.php is running, but errors out when it hits the WURFL directory, which I'll display in a minute.
Does anyone have any experience doing this? I couldn't find any similar examples on SO, or through regular google search that were able to help me.
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/*;
}
servers/bingo
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/";
}
}
My error message
Fatal error: Uncaught exception 'WURFL_Storage_Exception' with message 'The file storage directory is not writeable: /Library/WebServer/Documents/WURFL/examples/resources/storage/persistence/wurfl_1711' in /Library/WebServer/Documents/WURFL/WURFL/Storage/File.php:59 Stack trace: #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->__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): require('/Libr in /Library/WebServer/Documents/WURFL/WURFL/Storage/File.php on line 59
No one has answered yet, but I actually found the solution and rather than deleting the question I thought I'd post what I did to solve it instead, for any future devs with this issue.
It was just a file permissions issue. I navigated into the WURFL directory to where it specified:
/Library/WebServer/Documents/WURFL/examples/resources/storage/persistence
Then ran a recursive file permissions edit:
sudo chmod -R 666 wurfl_1711
After that I reloaded the site and it gave the same error for a different folder, so I navigated to that one and did it again.
Hope this helps someone!