【发布时间】:2019-02-12 07:45:32
【问题描述】:
问题
我目前有一个简单的 PHP 页面,在 localhost/info.php 上正确显示 phpinfo()。但是,当尝试通过输入“localhost/phpmyadmin”打开 phpmyadmin 时,它给了我这个:
我什至不介意我是否必须输入“localhost/phpmyadmin/index.php”才能使其工作,但这甚至不起作用。它基本上有相同的弹出窗口,但询问我是否要下载 PHP 文件:
我尝试了各种 nginx 配置,但下面的配置让我走到了这一步。任何帮助将不胜感激。
当前设置
- PHP 7.2.7
- nginx 1.15.0
- 迅奔图18.04
nginx.conf:
server {
listen 80;
listen [::]:80;
root /var/www/;
index index.php index.html index.htm index.nginx-debian.html;
server_name bacon.com;
location / {
try_files $uri $uri/ =404;
}
location ~ [^/]\.php(/|$) {
include fastcgi_params;
fastcgi_intercept_errors on;
fastcgi_pass unix:/run/php/php7.2-fpm.sock;
fastcgi_param SCRIPT_FILENAME
$document_root$fastcgi_script_name;
}
location ~ /\.ht {
deny all;
}
}
【问题讨论】:
标签: php nginx phpmyadmin