Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

phpmyadmin after login wrong URL

I have been looking for an answer to this problem but could not find it. So here it is: Log in page: http://192.168.1.1/phpmyadmin After loging in it sends me to: http://192.168.1.1/index.php?token=3d99b7b0606c6d60417b9dd2b7a2dc17

I have to add phpmyadmin/ before index.php to enter. After that I can navigate fine, but when I make some changes in phpmyadmin configuration and click Apply it shows an 404 page and I have to type again phpmyadmin after the ip address.

System Linux Debian 8 jessie Web Server nginx Default config file:

location /phpmyadmin {
        auth_basic "Admin Login";
        auth_basic_user_file /etc/nginx/pma_pass;
        index index.php;
}
like image 833
thor6006 Avatar asked Jun 01 '26 11:06

thor6006


2 Answers

Well lokks like I found the problem. There is a bug in nginx: bug

the error was in php configuration:

try_files $fastcgi_script_name =404;; <- remove this line add the following two:
    if (!-f $document_root$fastcgi_script_name) {
        return 404;
    }

Hope helps someone.

like image 80
thor6006 Avatar answered Jun 04 '26 03:06

thor6006


This is how I fixed this on Ubuntu.

Edit /etc/phpmyadmin/config.inc.php

After lines

$cfg['UploadDir'] = '';
$cfg['SaveDir'] = '';

Add such line with full absolute path to your phpmyadmin. Trailing slash is mandatory.

$cfg['PmaAbsoluteUri'] = 'http://12.345.67.89/phpmyadmin/';

After this my problem with wrong nginx redirection after login was fixed!

like image 25
Denis Borisov Avatar answered Jun 04 '26 01:06

Denis Borisov



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!