【问题标题】:Laravel5 and PhpMyadmin on Digital Ocean LEMP stack数字海洋 LEMP 堆栈上的 Laravel5 和 PhpMyadmin
【发布时间】:2016-01-19 08:50:34
【问题描述】:

我尝试使用以下教程在我的 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;
}

}

请帮帮我 谢谢

【问题讨论】:

    标签: nginx digital-ocean


    【解决方案1】:

    我也陷入了同样的境地。将此代码粘贴到 location ~ .php$ 函数之前,它工作得非常好。

    来源:Laravel routes overwriting phpmyadmin path with nginx

    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;
                }
        }
    

    【讨论】:

      猜你喜欢
      • 2014-11-20
      • 1970-01-01
      • 2020-06-09
      • 2018-02-22
      • 2021-04-02
      • 2013-10-14
      • 1970-01-01
      • 2015-08-04
      • 1970-01-01
      相关资源
      最近更新 更多