0

So I just upgraded my VPS from 14.04 to 16.04, the upgrade went well for most parts, but MySQL failed to update. I needed to manually remove mariadb-client first, and then I was able to install MySQL again, and everything on my website is now working fine, except for phpMyAdmin. Whenever I open the site.com/phpmyadmin page it displays an nginx 502 error, bad gateway.

The relevant parts of my nginx config file looks like this:

location ~ \.php$
{
    fastcgi_index index.php;
    fastcgi_keep_conn on;
    include /etc/nginx/fastcgi_params;
    fastcgi_pass unix:/var/run/php/php7.1-fpm.sock;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}

location /phpmyadmin
{
    root /usr/share;

    location ~ \.php$
    {
        include php.conf;
    }

    location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$
    {
        root /usr/share/;
    }
}

I looked around the net to see if anyone faced similar issues, but in most cases the solution was an incorrect php-fpm setting.

In my case it seems to be working well:

root@server:/etc/nginx/conf.d-enabled# service php7.1-fpm status
php7.1-fpm start/running, process 28542

root@server:/etc/nginx/conf.d-enabled# ls -l /var/run/php/php7.1-fpm.sock
srw-rw-rw- 1 www-data www-data 0 Jan  9 15:01 /var/run/php/php7.1-fpm.sock

PhpMyAdmin worked well before the upgrade to 16.04, and apart from removing mariadb-client nothing else happened besides the automatic process.

Any ideas where should I dig to find a solution? Thanks in advance for any help!

LBandy
  • 9
  • 2

2 Answers2

0

Change the fastcgi pass line

fastcgi_pass unix:/var/run/php/php7.0-fpm.sock
Sukhjinder Singh
  • 1,994
  • 2
  • 9
  • 17
0

So the solution was that in nginx config the link "include php.conf;" parsed a php.conf file which persumably got updated during the process. It was indeed a php-fpm issue, as it contained the "fastcgi_pass unix:/var/run/php/php5-fpm.sock" instead of "fastcgi_pass unix:/var/run/php/php7.1-fpm.sock":

connect() to unix:/var/run/php5-fpm.sock failed

After changing it I received the following error:

upstream sent too big header while reading response header from upstream, client

Adding the following lines there fixed the issue, I'm now able to access phpMyAdmin:

fastcgi_buffers 16 16k; 
fastcgi_buffer_size 32k;
LBandy
  • 9
  • 2