如何为WordPress配置nginx

时间:2012-11-25 作者:Ravika

我有一个正常工作的nginx、php-fpm和其他php包和mysql。我已经提取了wordpress-3.4.2。zip-in/usr/local/nginx/html/blog。当我访问本地主机/博客时,我得到“500内部服务器错误”。nginx是否需要进行任何特殊配置才能使wordpress正常工作?

1 个回复
最合适的回答,由SO网友:Oleg Butuzov 整理而成

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";
结束

相关推荐

Nginx rewrite rules

我对WordPress的Nginx重写算法有一些问题。我用它来重写,效果很好; server_name www.domain.com domain.com; if ($host != \'domain.com\') { rewrite ^/(.*) http://domain.com/$1 permanent; } 它生成此url;http://domain.com/?author=1 对此;http://domain.