0

I'm having a working nginx, php-fpm and other php packages and mysql. I've extracted wordpress-3.4.2.zip in /usr/local/nginx/html/blog. When I visit localhost/blog I get "500 internal server error". Is there any special configuration that needs to be done for nginx to make wordpress work?

3
  • 2
    error logs? configs? php configured under nginx as what? Nov 25, 2012 at 7:28
  • php is configured under nginx as php-fpm. Configs are all OK and valid.
    – Ravika
    Nov 25, 2012 at 7:33
  • You can configure nginx with WordPress with easyengine (goo.gl/Wzidcu). Nov 8, 2013 at 12:24

1 Answer 1

0

Provided info by you is SO huge... so i can only advice.

  1. run nginx - it works? goto step 2
  2. run nginx with php, see info.php with phpinfo() insie? goto step 3.
  3. run nginx with php and global host rewrite to this index script. It works ? go to step 4.
  4. run nginx with php and anabled error reporting (logs/display anything). do typo in script. see error? good. now you can TEST whats problem you have with php.

Generaly this is nginx issue not the wordpress. please back to us whan you willl do all these steps.

3) Script code and sample Nginx Configs

<?php var_dump($_SERVER['REQUEST_URI']); ?>

4) PHP bugly code.

<?php vardump($_SERVER['REQUEST_URI']);?>

NGINX (change error log location if you want.)

fastcgi_param PHP_VALUE "error_log=/var/log/nginx/host1.php.error.log";
7
  • Step 1 and 2 work. I don't understand what does step 3 and 4 mean. Can you provide a ready-made script that does step 3 and 4.
    – Ravika
    Nov 25, 2012 at 8:59
  • moment let me update answer Nov 25, 2012 at 9:00
  • Hey, you shoudl understand what you doing. Not just do something. So $_SERVER['REQUEST_URI'] return NULL. Back to your php envoiropment debug, you not passing variables to php. Nov 25, 2012 at 9:11
  • ok. we have php errors in step 4. it's OK. now back to step 3. you should organize on nginx rewrite system - it means that requsting site.com/test, site.com/demotest, site.com/onemore/test/ should output you a /test, /demotest, /onemore/test/... you need to tweak your nginx options to do that. after yo fix it we can continue with WP. Nov 25, 2012 at 9:24
  • googling for "nginx php-fpm rewrite" will give you enough samples. just skip all install sections and read carefuly about configuring a rewrite. don't forget about Codex article. Just you understand location principes - it look amazingly simple for you. Nov 25, 2012 at 9:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.