2014-03-12 13:51:01
来 源
中存储网
phpmyadmin
本文介绍Nginx服务器中安装配置phpMyAdmin过程记录,希望对于初学Nginx服务器相关的朋友有帮助,更多Nginx安装、配置、报错处理等资源请本站内搜索。。
使用nginx配置phpmyadmin时,一直无法显示。

配置如下

server {

listen   80;

server_name  localhost;

access_log  /var/log/nginx/localhost.access.log;

location / {

root   /home/www/colinux;

index  index.php index.html index.htm;

}

location /doc {

root   /usr/share;

autoindex on;

allow 127.0.0.1;

deny all;

}

location /images {

root   /usr/share;

autoindex on;

}

error_page   500 502 503 504  /50x.html;

location = /50x.html {

root   /var/www/nginx-default;

}

location ~ .php$ {

fastcgi_pass   127.0.0.1:9000;

fastcgi_index  index.php;

fastcgi_param  SCRIPT_FILENAME  /home/www/colinux$fastcgi_script_name;

include /etc/nginx/fastcgi_params;

}

location /phpmyadmin/ {

root   /home/www/;

}

location ~ /.ht {

deny  all;

}

查看错误日志发现这样的报错:

directory index of "/home/www/phpmyadmin/" is forbidden

刚开始以为是权限问题,可惜走错了方向。

最后发现原来没有指定index,加上就好了。就行下面一样。

location /phpmyadmin/ {

root   /home/www;

index index.php index.html index.htm;

location ~ .php$ {

fastcgi_pass   127.0.0.1:9000;

fastcgi_index  index.php;

fastcgi_param  SCRIPT_FILENAME  /home/www$fastcgi_script_name;

include /etc/nginx/fastcgi_params;

}

}

声明: 此文观点不代表本站立场;转载须要保留原文链接;版权疑问请联系我们。