未找到centos 7 nginx phpmyadmin

时间:2018-08-17 14:10:42

标签: nginx centos

访问链接:http://142.93.60.127/phpmyadmin

我的phpmyadmin.conf文件是

server {
        listen   80;
        server_name 142.93.60.127;


location /phpmyadmin {
        index  index.php;
        root /usr/share/phpMyAdmin;
}

## Images and static content is treated different
        location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|xml)$ {
        access_log        off;
        expires           30d;
}

location ~ /\.ht {
        deny  all;
}

location ~ /(libraries|setup/frames|setup/libs) {
        deny all;
        return 404;
}

location ~ \.php$ {
        include /etc/nginx/fastcgi_params;
        fastcgi_pass 127.0.0.1:9000;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME /usr/share/phpMyAdmin$fastcgi_script_name;
}
}

2 个答案:

答案 0 :(得分:0)

通常,当我遇到此问题时,这是权限问题。

确保对/ usr / share / phpMyAdmin目录及其中的文件具有正确的权限。正在运行nginx的用户需要执行对目录的访问权限,并具有对文件的读取权限。

也请尝试将“根”标志移到位置标志之外:

server {
    listen   80;
    server_name 142.93.60.127;
    root /usr/share/phpMyAdmin;


    location / {
        index  index.php;
    }

....
}

答案 1 :(得分:0)

我解决了这个问题,并写了一个博客

solution