phpmyadmin / docker

Docker container for phpMyAdmin
https://hub.docker.com/_/phpmyadmin
GNU General Public License v3.0
665 stars 456 forks source link

config.user.inc.php not used #382

Closed stanthewizzard closed 2 years ago

stanthewizzard commented 2 years ago

Installed with compose

---
---
version: '3.7'
services:
  db:
    image: mariadb:latest
    container_name: phpmyadmin_db
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: xxxxxxxxxxxxxxx

  phpmyadmin:
    image: phpmyadmin:latest
    container_name: phpmyadmin
    ports:
     - 8080:80
    volumes:
     - /sessions
     - "./config/config.user.inc.php:/etc/phpmyadmin/config.user.inc.php"
    restart: unless-stopped

config.user.inc.php:

<?php
$cfg['AllowArbitraryServer'] = true;

on the page no menu for the DB

if docker exec -it phpmyadmin /bin/bash apt update apt install vim

vi /etc/phpmyadmin/config.user.inc.php this is the file from thje docker thus 5.2.0 doesn't user config.user.inc.php or am I doing it wrong ?

adding to compose

    environment:
    - PMA_HOSTS=xxx,yyyy

does work

thank for help

williamdes commented 2 years ago

Hi @stanthewizzard You should use the ENV PMA_ARBITRARY

Adding

- PMA_ARBITRARY=1

It should work and do what you wanted To test if the file works fine you can make it "crash" by removing the ; If phpMyAdmin stops loading then we can conclude it was loaded and overridden somewhere I see nothing that would not allow the file to work except wrong permissions on the file

stanthewizzard commented 2 years ago

I added

  phpmyadmin:
    image: phpmyadmin:latest
    container_name: phpmyadmin
    environment:
    - PMA_ARBITRARY=1
    ports:
     - 8080:80
    volumes:
     - /sessions
     - "./config/config.user.inc.php:/etc/phpmyadmin/config.user.inc.php"
    restart: unless-stopped

It is parsed and work as adverdised

and

<?php
$cfg['AllowArbitraryServer'] = true

NO CRASH config.user.inc.php is not used IMHO

Thanks

EDIT: change the permission to 0755 Works Thank you

williamdes commented 2 years ago

EDIT: change the permission to 0755 Works Thank you

Great, closing this one since it is solved