Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong container config file location #376

Closed
binarweb opened this issue Jul 18, 2022 · 6 comments
Closed

Wrong container config file location #376

binarweb opened this issue Jul 18, 2022 · 6 comments
Assignees
Labels

Comments

@binarweb
Copy link

binarweb commented Jul 18, 2022

The custom configuration is said to be placed under /etc/phpmyadmin/config.user.inc.php.

By placing a file at the specified location with something like this in it:

<?php
echo "I'm here!";
exit;

will never load that file.

The actual file location in the container is specified in /var/www/html/libraries/vendor_config.php and it is /etc/phpmyadmin/config.inc.php.

@williamdes
Copy link
Member

I think this is because you did forget the php open tag <?php as a first line
What is your docker compose file?

@williamdes williamdes self-assigned this Jul 18, 2022
@binarweb
Copy link
Author

binarweb commented Jul 18, 2022

The php tags where there. I edited the issue.

version: "3"
services:
  phpmyadmin:
    image: phpmyadmin/phpmyadmin
    container_name: project_phpmyadmin
    ports:
      - 8081:80
    environment:
      PMA_HOST: project_mysql_database
      PMA_PORT: 3307
      PMA_ARBITRARY: 1
      MAX_EXECUTION_TIME: 600
      MEMORY_LIMIT: 512M
      UPLOAD_LIMIT: 2048M
      HIDE_PHP_VERSION: true
    volumes:
      - ./config.inc.php:/etc/phpmyadmin/config.inc.php
    restart: always
    mem_limit: 512m
networks:
  default:
    name: project_2022

Note: The container is connecting to another mysql container on port 3307.

@williamdes
Copy link
Member

williamdes commented Jul 18, 2022

First I would recommend you to use the Docker official repository (see #363):

- image: phpmyadmin/phpmyadmin
+ image: phpmyadmin

As it is said in https://github.com/phpmyadmin/docker#adding-custom-configuration
it is in /etc/phpmyadmin/config.user.inc.php and you did use /etc/phpmyadmin/config.inc.php
So you would need to change

- - ./config.inc.php:/etc/phpmyadmin/config.inc.php
+ - ./config.inc.php:/etc/phpmyadmin/config.user.inc.php

Could you try again with such changes ?

@binarweb
Copy link
Author

binarweb commented Jul 20, 2022

@williamdes It seems that you wondered off my original post.

I didn't had a problem with running the container. The container is running just fine.

It was just that the custom configuration file path was wrong in the README.md of this repo.

The original config.user.inc.php should be changed with config.inc.php in the README.md of this repo, as the config.user.inc.php file will never be loaded.

@williamdes
Copy link
Member

The original config.user.inc.php should be changed with config.inc.php in the README.md of this repo, as the config.user.inc.php file will never be loaded.

I really do not understand, it is loaded and we have tests for that:

- ../config.user.inc.php:/etc/phpmyadmin/config.user.inc.php:ro

@binarweb
Copy link
Author

By loading config.user.inc.php as a volume, I'm unable to reproduce the error.

I think my error appeared because I started a container without volumes and then created a /etc/phpmyadmin/config.user.inc.php and tested it like that. And it didn't worked. I don't remember the exact steps I took.

Anyway, thanks for the help! My issue is invalid.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants