A
A
Artyom2015-04-28 04:09:25
PHP
Artyom, 2015-04-28 04:09:25

Nginx + FPM = Why phpMyAdmin 403?

DigitalOcean, LEMP on Ubuntu 14.04, multiple Virtual Hosts. Everything works except phpMyAdmin.
Installed via PuTTY:
1 apt-get update
2 apt-get install phpmyadmin
3 ln -s /usr/share/phpmyadmin /usr/share/nginx/html
4 php5enmod mcrypt
5 sudo service php5-fpm restart
In response 403
Server default settings:

server {
    listen 80 default_server;
    listen [::]:80 default_server ipv6only=on;

    root /usr/share/nginx/html;
    index index.html index.htm;

    server_name localhost;

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

The rest of the domains are almost in the same way, the difference is at the beginning, so that they work:
server {
        listen 80;
        listen [::]:80;

PS I looked through Google and Toaster, I did not find a solution :-(

Answer the question

In order to leave comments, you need to log in

4 answer(s)
N
n1mda, 2015-04-28
@n1mda

A person wants phpmyadmin to be like an alias in Apache, it's as old as the world

location ^~ /pma/ {
            alias /usr/share/phpmyadmin/;
            index index.php index.html;
            location ~ /pma(/.*\.php) {
                include fastcgi_params;
                fastcgi_param SERVER_NAME localhost;
                fastcgi_param SCRIPT_FILENAME /usr/share/phpmyadmin$1;
                fastcgi_pass unix:/var/run/php5-fpm.sock;
                fastcgi_index index.php;
                }
        }

insert this after describing all your lokashin

6
65536, 2015-04-28
@65536

Dudes use www.adminer.org Phpmayadmin is needed only to administer databases.

A
Alexander, 2015-04-28
@bIbI4k0

And where do you proxy to php5-fpm?

V
Vadim Yakovlev, 2015-04-28
@1nn0

server {
        listen  8080;

        client_max_body_size 32m;

        root /usr/share/phpmyadmin;

        index index.php;

        server_name phpmyadmin;

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

        location ~ \.php$ {
                include snippets/fastcgi-php.conf;
                fastcgi_pass unix:/var/run/php5-fpm.sock;
        }
        location ~ /\.ht {
                deny all;
        }
}

Adjust for yourself and it will work.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question