You are not logged in.

#1 2021-05-24 21:28:30

From: Germany
Registered: 2013-05-07
Posts: 48

[Solved] PhpMyAdmin Login loop

So I tried to install phpMyAdmin. I followed the instructions from the Arch wiki closely.
More specifically:

  • I installed phpmyadmin from the official repos.

  • I added the recommended lines as is to /etc/httpd/conf/extra/phpmyadmin.conf and /etc/httpd/conf/httpd.conf

  • I restarted Apache

  • I also had to activate the iconv extension for PHP since phpMyAdmin requested it.

  • I additionally had to make /usr/share/webapps/phpMyAdmin/ writable for the http user as phpMyAdmin gave me an error message that it couldn't create some temporary files in it.

  • I did not change anything in the config file that came with the installation. I also did not execute the setup script (which refuses to do any action anyway since there is already a config file).

However whenever I try to login I'm immediately redirected back to the login page.
There are no error messages, neither on-screen in the browser nor in my Apache logs (/var/log/httpd/error_log, which is where PHP error messages are written to).
I'm currently using the root user which is a user with all privileges. However I never had any issues using the root user on other servers that ran phpMyAdmin.
After I realized it wasn't working I also tried executing the optional steps described in the wiki:

  • I added the blowfish_secret which I created with openssl. (32 characters as required)

  • I uncommented all the phpMyAdmin configuration storage lines and replaced the password with a 16 character long string created by openssl.

  • I executed the create_tables.sql using mysql -u root -p < ... and successfully executed the code provided in the wiki - also via mysql -u root -p and with the same 16 character long password instead of pmapass.

  • Also as described in the wiki I activated template caching.

Since all of these are optional they shouldn't have changed anything. And they didn't. I just thought I mentioned it here.

Apache is working fine. So is PHP and mariadb. I wrote a small script just to check:

header("Content-Type: text/plain");

$servername = "localhost";
$username = "root";
$password = "******";
$dbname = "testdb";

$conn = new mysqli($servername, $username, $password);
    die("Connection failed: " . $conn->connect_error);

if($conn->query("CREATE DATABASE $dbname") === true)
    echo "Database created successfully\n";
        echo "Switched successfully to database $dbname\n";
        if($conn->query("CREATE TABLE Person (id INT(6) AUTO_INCREMENT PRIMARY KEY, name VARCHAR(30) NOT NULL)") === true)
            echo "Table Person created successfully\n";
            echo "Error creating table: " . $conn->error;
    } else
        echo "Error switching database: " . $conn->error;
    echo "Error creating database: " . $conn->error;

browser wrote:

Database created successfully
Switched successfully to database testdb
Table Person created successfully

Using mysql -u root -p I was able to verify that the aforementioned database and table were indeed created.

What could cause phpMyAdmin to fail? Aren't there any logs specific to phpMyAdmin?

The versions of the used server software:

$ mysqld --version
mysqld  Ver 10.5.10-MariaDB for Linux on x86_64 (Arch Linux)
$ php --version
PHP 8.0.5 (cli) (built: Apr 27 2021 18:07:13) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.5, Copyright (c) Zend Technologies
$ apachectl -V
Server version: Apache/2.4.46 (Unix)
Server built:   Oct 14 2020 18:59:56
Server's Module Magic Number: 20120211:93
Server loaded:  APR 1.7.0, APR-UTIL 1.6.1
Compiled using: APR 1.7.0, APR-UTIL 1.6.1
Architecture:   64-bit
Server MPM:     prefork
  threaded:     no
    forked:     yes (variable process count)
$ pacman -Qs phpmyadmin
local/phpmyadmin 5.1.0-1
    PHP and hence web-based tool to administrate MySQL over the WWW

Last edited by scindix (2021-05-25 19:26:03)


#2 2021-05-24 23:30:23

From: Germany
Registered: 2013-05-07
Posts: 48

Re: [Solved] PhpMyAdmin Login loop

Okay. I think I found the issue. But I don't have a satisfying fix yet.

I downgraded to PHP 7.4 (using AUR packages). After that phpMyAdmin works fine without the login loop occurring.
The problem of course is that I have to use PHP 7 and can't take advantage of the newer version.

I just read in their Changelog that they fixed a lot of compatibility issues with PHP 8 in phpMyAdmin 5.1.0 which is exactly the version I have installed. Also the PHP 8 compatibility issue is listed under the milestone for 5.1.0 and has been closed in January. So I assume it should at least go past the login screen? But I don't know.

I guess I'm reporting this issue upstream.

Edit: I've reported it. Here is the issue I created.

Meanwhile I'm open to suggestions for a workaround. Especially if I want to keep working with PHP 8 on my other sites.

Last edited by scindix (2021-05-25 00:34:16)


#3 2021-05-25 19:25:38

From: Germany
Registered: 2013-05-07
Posts: 48

Re: [Solved] PhpMyAdmin Login loop

Well, a guy from phpMyAdmin helped me on GitHub and it turned out to be my fault. It's also not related to Arch Linux.

I had to disable post data reading for a different project some time ago. But I completely forgot about it. After reenabling it phpMyAdmin works fine. I ended up disabling it only in the subdirectory that requires it. So my other project works as well.

<Directory "/srv/http/myproject">
    php_value enable_post_data_reading Off


Board footer

Powered by FluxBB