Skip to main content

phpmyadmin blank page after login using nginx / php-fpm [Resolved]

i can access www.***/phpmyadmin to login. if i log in with mysql user just hit blank page with no error. System runs on raspbian.

Installed : nginx 1.2.1 , php5.4.36

i tryed login from different browsers on different machines.i reset the cookies. url changed to phpmyadmin/index.php?token=****3a35b78052f67500a6bb2bd411e6

my nginx config :

    upstream php-handler {
    server 127.0.0.1:9000;
    #server unix:/var/run/php5-fpm.sock;
    }

    server {
    listen 80;
    server_name ***.net;
    return 301 https://$server_name$request_uri; # enforce https
    }

    server {
    listen 443 ssl;
    server_name ***.net;

    ssl_certificate /etc/nginx/cert.pem;
    ssl_certificate_key /etc/nginx/cert.key;

    ssl_ciphers "AES128+EECDH:AES128+EDH";
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    ssl_prefer_server_ciphers on;
    ssl_session_cache shared:SSL:10m;
    add_header Strict-Transport-Security "max-age=63072000; includeSubDomains";
    add_header X-Frame-Options DENY;
    add_header X-Content-Type-Options nosniff;

    # Path to the root of your installation
    root /var/www/owncloud;

    client_max_body_size 1000M; # set max upload size
    fastcgi_buffers 64 4K;

    rewrite ^/caldav(.*)$ /remote.php/caldav$1 redirect;
    rewrite ^/carddav(.*)$ /remote.php/carddav$1 redirect;
    rewrite ^/webdav(.*)$ /remote.php/webdav$1 redirect;

    index index.php
    error_page 403 /core/templates/403.php;
    error_page 404 /core/templates/404.php;

    location = /robots.txt {
    allow all;
    log_not_found off;
    access_log off;
 }


# phpmyadmin
location /phpmyadmin {
alias   /usr/share/phpmyadmin;
index   index.php;
}

location ~ ^/phpmyadmin/libraries {
deny all;
}

location ~ ^/phpmyadmin/setup/lib {
deny all;
}

location ~ ^/phpmyadmin/setup/(.+\.php)$ {
auth_basic              "phpMyAdmin Setup";
auth_basic_user_file    "/etc/phpmyadmin/htpasswd.setup";
alias                   /usr/share/phpmyadmin/setup/$1;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass            php-handler;
fastcgi_index           index.php;
include                 fastcgi_params;
}

location ~ ^/phpmyadmin/(.+\.php)$ {
alias                   /usr/share/phpmyadmin/$1;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass            php-handler;
fastcgi_index           index.php;
include                 fastcgi_params;
}

location ~ ^/(?:\.htaccess|data|config|db_structure\.xml|README) {
    deny all;
}


location ~ \.php(?:$|/) {
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    include fastcgi_params;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    fastcgi_param PATH_INFO $fastcgi_path_info;
    fastcgi_param HTTPS on;
    fastcgi_pass php-handler;
    fastcgi_index index.php;
}

# Optional: set long EXPIRES header on static assets
location ~* \.(?:jpg|jpeg|gif|bmp|ico|png|css|js|swf)$ {
expires 30d;
# Optional: Don't log access to assets
access_log off;
}

}

I appreciate your help


Question Credit: DAU
Question Reference
Asked April 5, 2019
Tags: nginx, login
Posted Under: Unix Linux
52 views
2 Answers

I think I've just run into the same problem, though with Apache. If you view source on the page do you see the bulk of the html still but empty frames?

If so then the problem is most likely because of the following line in your nginx setup:

add_header X-Frame-Options DENY;

Setting this to SAMEORIGIN brought phpmyadmin back for me, this directive is preventing the page from being displayed in a frame in any context.

I couldn't find any errors in any of the logs tried.


credit: Rui F Ribeiro
Answered April 5, 2019

Looks like there is a file permission conflict, please set the same user to run at for nginx and php-fpm, most common "nginx" or "www-data". The config files are /etc/php-fpm.d/www.conf and /etc/nginx.conf. You can set the user and group for the hpMyadmin files with chown nginx:nginx /usr/share/phpmyadmin/* for example.


credit: Jannis
Answered April 5, 2019
Your Answer