R
R
Ruslan Absalyamov2018-04-23 20:08:18
linux
Ruslan Absalyamov, 2018-04-23 20:08:18

Why does my bin file download when I open phpmyadmin?

I have such a problem that when I open the localhost/phpmyadmin site, my page offers to download the bin file. If you take localhost:81/phpmyadmin then this content opens 5ade119ce11de540599326.png
My implementation in nginx
/etc/nginx/sites-available/default I added the following code

location /phpmyadmin {
    root /usr/share/;
    index index.htm index.html index.php;
    location ~ ^/phpmyadmin/(.+.php)$ {
        try_files $uri = 404;
        root /usr/share/;
        # fastcgi_pass 127.0.0.1:9000; # раскомментировать при использовании php5-cgi
        fastcgi_pass unix:/var/run/php5-fpm.sock; 
      # раскомментировать при использовании php5-fpm
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $request_filename;
        include /etc/nginx/fastcgi_params;
    }
    location ~* ^/phpmyadmin/(.+.(html|ico|xml|css|jpg|png|js|txt|gif|jpeg))$ {
        root /usr/share/;
    }
      }
      location /phpMyAdmin {
    rewrite ^/* /phpmyadmin last;
      }

}

Accordingly, there is already a symbolic link with sites-enabled
And if necessary, then apache2 I have the configuration set up like this
NameVirtualHost *:81
Listen 127.0.0.1:81

Rebooted nginx and apache, everything works fine, in principle, this is natural since the sites work, only difficulties in opening it

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Ruslan Absalyamov, 2018-04-23
@rusline18

If through apache2 then this was not enoughsudo apt-get install libapache2-mod-php7.0

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question