Nginx – phpMyAdmin on CentOS 7 with NGINX returns blank page

nginxphpmyadmin

I have installed CentOS 7 in Virtual Machine with NGINX.

PHP, MariaDB and everything else is installed and working fine. However, when I access the http://localhost/phpMyAdmin it shows blank page.

Anyone knows why?

My nginx.conf is as follows:

user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;
events {
    worker_connections  1024;
}
http {
    # Upstream to abstract back-end connection(s) for PHP
    upstream php {
        server unix:/var/run/php-fpm/php-fpm.sock;
    }
    include       mime.types;
    default_type  application/octet-stream;

    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    access_log  /var/log/nginx/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;

    #gzip  on;

    #Load configuration files for the default server block.
    include /etc/nginx/default.d/*.conf;

    #Load virtual hosts enabled
    include /etc/nginx/sites-enabled/*.conf;

    server {
    listen 80 default; ## listen for ipv4; this line is default and implied
        listen [::]:80 default ipv6only=on; ## listen for ipv6
        server_name  localhost;
        root         /usr/share/nginx/html;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;

        location / {
            root   html;
            index  index.php index.html index.htm;
        }

        #error_page  404              /404.html;

        # redirect server error pages to the static page /50x.html
        #
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }

        # proxy the PHP scripts to Apache listening on 127.0.0.1:80
        #
        #location ~ \.php$ {
        #    proxy_pass   http://127.0.0.1;
        #}

        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
        #
        location ~ \.php$ {
            root           html;
            fastcgi_pass   unix:/var/run/php-fpm/php-fpm.sock;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
            include        fastcgi_params;
        }

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

}

ERROR LOG

2016/05/27 16:35:58 [error] 12369#0: *1 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Call to undefined function __() in /usr/share/phpMyAdmin/libraries/core.lib.php on line 245" while reading response header from upstream, client: 127.0.0.1, server: localhost, request: "GET /phpMyAdmin/ HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-fpm/php-fpm.sock:", host: "localhost"

Best Answer

I think the session folder is not writable by the web service try to change permission

chmod -R 777 /var/lib/php/session