Laravel5 和 PhpMyadmin 在 Digital Ocean LEMP 堆栈上



我尝试使用以下教程在我的 LEMP 服务器上安装 phpMyadmin

https://www.digitalocean.com/community/tutorials/how-to-install-phpmyadmin-on-a-lemp-server

但是当我尝试访问myip/phpmyadmin时,我找不到页面

在此之前,我安装了 Laravel5,所以我在 ip/anystring 之后输入的任何内容都可以通过我的 Laravel路由页面访问,

所以你能告诉我如何访问phpMyadmin

我的IP是 http://xxxxxxxx//phpmyadmin。

我的 nginx 默认页面如下所示

server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
root /var/www/laravel/public;
index index.php index.html index.htm;
# Make site accessible from http://localhost/
server_name xxxxxxx;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ /index.php?$query_string;
# Uncomment to enable naxsi on this location
# include /etc/nginx/naxsi.rules
}
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
location ~ .php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
}

请把我赶出去谢谢

我也陷入了同样的情况。将此代码粘贴在位置~.php$函数之前,它工作得很好。

来源 : Laravel路由用nginx覆盖phpmyadmin路径

location /phpmyadmin {
            root /usr/share/nginx/html;
            location ~ ^/phpmyadmin/(.+.php)$ {
                    try_files $uri =404;
                    root /usr/share/nginx/html;
                    fastcgi_pass unix:/var/run/php5-fpm.sock;
                    fastcgi_index index.php;
                    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                    include /etc/nginx/fastcgi_params;
            }
            location ~* ^/phpmyadmin/(.+.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
                    root /usr/share/nginx/html;
            }
    }

最新更新