dustytrash
dustytrash

Reputation: 1590

phpmyadmin giving 404 not found inside docker container

I am trying to connect a database to Wordpress and Phpmyadmin inside a docker container. My docker file looks something like this:

db:
  image: mysql:5.7
  restart: always
  # https://hub.docker.com/_/mysql#environment-variables
  environment:
    MYSQL_ROOT_PASSWORD: password
    MYSQL_DATABASE: wordpress
    MYSQL_USER: wordpress
    MYSQL_PASSWORD: wordpress
  networks:
    - wpsite
phpmyadmin:
  depends_on:
    - db
  image: phpmyadmin/phpmyadmin
  restart: always
  ports:
    - '8080:80'
  environment:
    PMA_HOST: db
    MYSQL_ROOT_PASSWORD: password
networks:
  - wpsite

When I visit localhost:8080/phpmyadmin (Note: web application is using a different port), I get a '404 not found page'. The logs show the entry and 404 response.

Following this post, I've issued the following commands in docker:

sudo ln -s /usr/share/phpmyadmin/ /var/www/html/phpmyadmin
lrwxrwxrwx 1 root root   22 Apr  4 14:31 phpmyadmin -> /usr/share/phpmyadmin/

However after doing this I get a 403 forbidden error. Again the docker logs show the same thing.

Upvotes: 1

Views: 1817

Answers (1)

dustytrash
dustytrash

Reputation: 1590

Reset the docker container & visit localhost:8080. Not localhost:8080/phpmyadmin

Taking a 5 minute break was the real solution. Hate to admit I spent a few hours googling & trying different solutions.

Upvotes: 3

Related Questions