nazar-pc / docker-phpmyadmin

phpMyAdmin as Docker container, based on official image, always latest version
40 stars 16 forks source link

Using custom settings leads to a PMA fatal error #17

Closed Kern046 closed 7 years ago

Kern046 commented 7 years ago

Hello there !

Thank you for your container, it has been very useful to me for quite a moment now !

But now my team seeks comfort, and asks me little things, like removing the table list pagination !

I tried it following the documentation, using the environment variable JSON_CONFIG in my docker-compose.yml file, but it seems to bring chaos to PMA. I get the following error :

Fatal error: Call to a member function getName() on null in /var/www/html/libraries/ThemeManager.php on line 507

I am using the latest version of the container, and my docker-compose looks like this :

mysql:
    container_name: my_mysql
    build: mysql
    environment:
        - MYSQL_DATABASES=database_1,database_2
        - MYSQL_ROOT_PASSWORD=vagrant
        - MYSQL_HOST=localhost
        - MYSQL_PORT=33306
        - MYSQL_USER=me
        - MYSQL_PASSWORD=incredible_pwd
    ports:
        # MySQL
        - "33306:3306"
    volumes:
        # Mysql
        - "./volumes/mysql:/var/lib/mysql"

phpmyadmin:
    container_name: my_phpmyadmin
    image: nazarpc/phpmyadmin
    ports:
        # PHPMyAdmin HTTP
        - "8082:80"
    links:
        - mysql:mysql
    environment:
        - SESSION_TIMEOUT=86400
        - JSON_CONFIG="{'MaxTableList':450}"
nazar-pc commented 7 years ago

This is because your JSON is not JSON:) Try following:

JSON_CONFIG="{\"MaxTableList\":450}"
Kern046 commented 7 years ago

Oups I let one of my tests in the example !

The thing is that I already tried the above code ! It doesn't work either !

nazar-pc commented 7 years ago

It was incorrect syntax too. Here is correct one:

JSON_CONFIG={"MaxTableList":450}
Kern046 commented 7 years ago

Ah, it worked ! I was sure I did test it too, but at least it works ! Even if the configuration key was flse, I found the right one !

Sorry for disturbing, and thanks for your reactivity :D ! Keep going on !

nazar-pc commented 7 years ago

Glad to know it works for you