D
D
Dmitriy2020-11-13 23:47:58
PHP
Dmitriy, 2020-11-13 23:47:58

Why does it download a file when trying to go to phpmyadmin?

Installed Nginx, I want to install phpmyadmin. During installation, in the window where you need to select a server, I do not select anything, I click "OK", in /etc/nginx/sites-available/default like this:

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

  root /var/www/html;

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

  server_name _;
  
  location / {
    try_files $uri $uri/ =404;
  }
  location /phpmyadmin {
               root /usr/share/;
               index index.php index.html index.htm;
               location ~ ^/phpmyadmin/(.+\.php)$ {
                       try_files $uri =404;
                       root /usr/share/;
                       fastcgi_pass unix:/var/run/php/php7.4-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/;
               }
        }
        location /phpMyAdmin {
               rewrite ^/* /phpmyadmin last;
        }
  #location ~ \.php$ {
  #	include snippets/fastcgi-php.conf;
  
    # With php-fpm (or other unix sockets):
  #	fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
    # With php-cgi (or other tcp sockets):
  #	fastcgi_pass 127.0.0.1:9000;
  #}
}


When I go to /localhost/phpmyadmin
Just downloads the file.

How to fix this matter?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question