nginxinc/nginx-wiki

Possibly outdated wordpress recipe - not working with php-fpm

jpm92 opened this issue · 4 comments

jpm92 commented

Hello, these last two days I've been struggling to make wordpress work with nginx. I followed the recipe (https://github.com/nginxinc/nginx-wiki/blob/master/source/start/topics/recipes/wordpress.rst) but first I got 502 error and later just blank pages. After endlessly searching all over the internet, I managed to fix it by editing the server block that the recipe suggested like so:

location ~ \.php$ {
                #NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
                include fastcgi_params; #originally included fastcgi.conf which is not present in the latest stable package
                fastcgi_intercept_errors on;
                fastcgi_pass php;
                fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name; 
                #this parameter is necessary either in this block or inside fastcgi_params file
        }

Maybe it was my fault and I missed some information, but in case it is outdated I think it would be great to update that information as per the latest package.

Thanks in advance,
J.

Hiya @jpm92! Do you think you could submit a PR with the relevant changes?

jpm92 commented

Hiya @jpm92! Do you think you could submit a PR with the relevant changes?

I'm still getting around to github, but I think I can do it. I'll keep you posted.

Thanks!
J.

jpm92 commented

Sorry for the delay @alessfg
PR is finally done. I hope I did everything right.

Thanks!

Resolved by #489 😄