Tonight I upgraded my Ubuntu 14.0 server to the latest of Nginx & PHP5-FPM packages which broke my WordPress site running the latest 3.9.1 version of WordPress so I thought I would share the fixes used to resolve it.
It broke it in two different places, one was a PHP5-FPM related error the other was related to Nginx so I have split each resolution below.
First error: PHP5FPM
Firstly the issue straight after the upgrade was that I would get a “505 Error page not found” fault, I checked the nginx error log files to find this error: connect() to unix:/var/run/php5-fpm.sock failed (13: Permission denied).
The fix was update the php5 config file: /etc/php5/fpm/pool.d/www.conf
Find this block:
;listen.owner = www-data
;listen.group = www-data
;listen.mode = 0660
Now edit the block to look like this:
listen.owner = www-data
listen.group = www-data
listen.mode = 0666
Now restart php5-fpm “service php5-fpm restart”
Second error: Nginx
This solved the first error but now I am getting a second error relating to the Nginx upgrade to version Nginx 1.4.6.
The error in the Nginx logs: “rewrite or internal redirection cycle while internally redirecting”
The resolution is to add this line of code into each Nginx server config, NOTE if might have two one for port 80 one for port 443 etc
I just added this block:
if(!–e$request_filename){
rewrite^(.*)$/index.php?q=$1last;
break;
}
Now restart Nginx: “service nginx restart” after rebooting all of my errors have been resolved.
Please use the above at your own risk and do your own research but in my case this has resolved my issues.