NGINX + phpmyadmin

I installed NGINX / mysql-server and phpmyadmin without an error - but when I am calling http://localhost/phpmyadmin it wants to download a binary file.

Why is that so? I can access the normal localhost NGINX default site. I linked the /usr/share/phpmyadmin folder with ln -s and also restarted my php7.0-fpm service as well as my nginx and mysql service.

server {
    listen 80 default_server;
    listen [::]:80 default_server;


    root /var/www/html;

    index index.html index.htm index.nginx-debian.html;

    server_name localhost;

    location / {
        try_files $uri $uri/ =404;
    }


    location ~ \.php$ {
        include snippets/fastcgi-php.conf;

    #   # With php7.0-cgi alone:
    #   fastcgi_pass 127.0.0.1:9000;
    #   # With php7.0-fpm:
        fastcgi_pass unix:/run/php/php7.0-fpm.sock;
    }

    # deny access to .htaccess files, if Apache's document root
    # concurs with nginx's one
    #
    #location ~ /\.ht {
    #   deny all;
    #}


}


# Virtual Host configuration for example.com
#
# You can move that to a different file under sites-available/ and symlink that
# to sites-enabled/ to enable it.
#
#server {
#   listen 80;
#   listen [::]:80;
#
#   server_name example.com;
#
#   root /var/www/example.com;
#   index index.html;
#
#   location / {
#       try_files $uri $uri/ =404;
#   }
#}

EDIT: info.php with phpinfo(); in /var/www/html works fine also

-1
задан 14 September 2017 в 12:09
2 ответа

Я думаю, вы забыли включить index.php в директиву index вашей конфигурации.

Ваша директива index должна выглядеть так.

index index.php index.html index.htm index.nginx-debian.html;

Сообщите мне, если это поможет!

0
ответ дан 5 December 2019 в 20:23

Я думаю, вам нужно указать phpmyadmin в качестве дополнительных блоков сайта / нескольких виртуальных хостов, поскольку он не находится на пути к srv по умолчанию (из того, что вы разместили здесь / var / www / html)

0
ответ дан 5 December 2019 в 20:23

Теги

Похожие вопросы