I have successfully installed Laradock/Docker (latest version) as well as phpMyAdmin on Mac Monterey. Everything finally works smoothly, but I can not find the config file of phpMyAdmin to add external web servers.
On previous installations (not Laradock), the file phpmyadmin.config.inc.php was in usr/local/etc.
I tried to put the file there with an echo/exit command there but nothing happens. I also tried to put the file in the laradock/phpMyAdmin folder... same result.
What is the solution to add external servers in a config file for phpMyAdmin?
EDIT ++++
The file laradock/phpmyadmin/config.user.inc.php/phpmyadmin.config.inc.php was created by Docker.
Here is the volume in docker-compose.yml
phpmyadmin:
build: ./phpmyadmin
environment:
- PMA_ARBITRARY=1
- MYSQL_USER=${PMA_USER}
- MYSQL_PASSWORD=${PMA_PASSWORD}
- MYSQL_ROOT_PASSWORD=${PMA_ROOT_PASSWORD}
- MAX_EXECUTION_TIME=${PMA_MAX_EXECUTION_TIME}
- MEMORY_LIMIT=${PMA_MEMORY_LIMIT}
- UPLOAD_LIMIT=${PMA_UPLOAD_LIMIT}
ports:
- "${PMA_PORT}:80"
volumes:
- ./phpmyadmin/config.user.inc.php/phpmyadmin.config.inc.php:/etc/phpmyadmin/config.user.inc.php
depends_on:
- "${PMA_DB_ENGINE}"
networks:
- frontend
- backend
Solution:
docker-compose down -v
I've tested this setup with the following in the docker-compose file:
phpmyadmin:
build: ./phpmyadmin
environment:
- PMA_ARBITRARY=1
- MYSQL_USER=${PMA_USER}
- MYSQL_PASSWORD=${PMA_PASSWORD}
- MYSQL_ROOT_PASSWORD=${PMA_ROOT_PASSWORD}
- MAX_EXECUTION_TIME=${PMA_MAX_EXECUTION_TIME}
- MEMORY_LIMIT=${PMA_MEMORY_LIMIT}
- UPLOAD_LIMIT=${PMA_UPLOAD_LIMIT}
ports:
- "${PMA_PORT}:80"
volumes:
- ./phpmyadmin/config.user.inc.php/phpmyadmin.config.inc.php:/etc/phpmyadmin/config.user.inc.php
depends_on:
- "${PMA_DB_ENGINE}"
networks:
- frontend
- backend
and yes, that's exactly the same as your last updated docker-compose example in your original question
The thing I tested in my phpmyadmin.config.inc.php
was, to change the $cfg['MaxRows'] = 100;
and it worked.
Advised changes and explanation
docker-compose down -v
mv phpmyadmin.config.inc.php ..
config.user.inc.php
and a file of phpmyadmin.config.inc.php
, see screenshotconfig.user.inc.php
phpmyadmin.config.inc.php
to config.user.inc.php
docker-compose.yml
[] rm -Rf config.user.inc.php
[]
mv phpmyadmin.config.inc.php config.user.inc.php
Your directory structure should look like this:
[] adjust docker-compose.yml:
volumes:
- ./phpmyadmin/config.user.inc.php:/etc/phpmyadmin/config.user.inc.php
bring your containers up again:
docker-compose up nginx mysql php-fpm phpmyadmin workspace -d
Explanation
In your docker-compose.yml
file you had a volume like this:
volumes:
- ./phpmyadmin/config.user.inc.php/phpmyadmin.config.inc.php:/etc/phpmyadmin/config.user.inc.php
If docker cannot find the file, it creates a directory with that filename, to make the volume. That is the reason why your changes didn't come through. If you bring the container down again (volume down as well), that created directory doesn't get deleted.
The suggestion is to remove the /phpmyadmin.config.inc.php
and place the config.user.inc.php
file in the phpmyadmin directory (next to the Dockerfile)
If you correct your docker-compose.yml
file and then do the docker-compose up
it will add your volume with the correct file.
In the end I added this to the config file:
$cfg['Servers'][$i]['hide_db'] = 'default|information_schema|mysql|performance_schema|sys';
and the system tables are missing from my phpmyadmin screen: