The Wayback Machine - https://web.archive.org/web/20200915171540/https://github.com/phpmyadmin/docker/issues/230
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

No matching DirectoryIndex / 403 Forbidden error #230

Open
iquito opened this issue Jun 18, 2019 · 4 comments
Open

No matching DirectoryIndex / 403 Forbidden error #230

iquito opened this issue Jun 18, 2019 · 4 comments
Labels
bug

Comments

@iquito
Copy link

@iquito iquito commented Jun 18, 2019

When using phpmyadmin/phpmyadmin:latest or phpmyadmin/phpmyadmin:4.9 or phpmyadmin/phpmyadmin:4.8 accessing phpmyadmin via browser is not possible - this is the output from the container with latest:

phpmyadmin    | phpMyAdmin not found in /usr/src/app - copying now...
phpmyadmin    | Complete! phpMyAdmin has been successfully copied to /usr/src/app
phpmyadmin    | AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.20.0.3. Set the 'ServerName' directive globally to suppress this message
phpmyadmin    | AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.20.0.3. Set the 'ServerName' directive globally to suppress this message
phpmyadmin    | [Tue Jun 18 10:30:23.799723 2019] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.25 (Debian) PHP/7.2.19 configured -- resuming normal operations
phpmyadmin    | [Tue Jun 18 10:30:23.799923 2019] [core:notice] [pid 1] AH00094: Command line: 'apache2 -D FOREGROUND'
phpmyadmin    | [Tue Jun 18 10:30:32.464147 2019] [autoindex:error] [pid 31] [client 172.20.0.1:46976] AH01276: Cannot serve directory /var/www/html/: No matching DirectoryIndex (index.php,index.html) found, and server-generated directory index forbidden by Options directive
phpmyadmin    | 172.20.0.1 - - [18/Jun/2019:10:30:32 +0000] "GET / HTTP/1.1" 403 503 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0"

And in the browser a 403 Forbidden error appears, so at least index.php seems to be missing in /var/www/html/ or maybe that directory is not correct.

If I use phpmyadmin/phpmyadmin:4.7 everything works fine, so a recent change seems to have caused this.

@ibennetch
Copy link
Member

@ibennetch ibennetch commented Jun 19, 2019

I'm afraid I'm having trouble reproducing this. What is the exact command you're using to start the container, please?

I've just now successfully connected with

  • docker run --name pma49 -d -e PMA_HOST=192.168.56.2 -p 8091:80 phpmyadmin/phpmyadmin:4.9
  • docker run --name pmalatest -d -e PMA_HOST=192.168.56.2 -p 8090:80 phpmyadmin/phpmyadmin:latest

Accessing, of course, http://localhost:8090 and http://localhost:8091.

@iquito
Copy link
Author

@iquito iquito commented Jun 19, 2019

I just checked my configuration again (from docker-compose), and the aspect which made it not work in 4.8 and 4.9 was me setting working_dir, which was just some leftover configuration from a previous container, which made the container copy the phpmyadmin files to that directory and not /var/www/html/ so Apache did not find any files at the expected location.

Not sure if this is the intentional behavior or not - it was certainly an unnecessary configuration on my part which led to the problem, but maybe setting a working directory should be ignored or used in the Apache config too, so everything is served from the defined working directory. This was my configuration for docker-compose which led to the problem:

version: "3.7"
services:
    phpmyadmin:
        image: phpmyadmin/phpmyadmin
        container_name: phpmyadmin
        tty: true
        working_dir: /usr/src/app
        ports:
            - "8080:80"
        networks:
            - app-network
        environment:
            PMA_HOST: 'db_schema'
            PMA_PORT: 3306
            PMA_USER: 'user'
            PMA_PASSWORD: 'password'

    db_schema:
        image: mysql/mysql-server:5.7
        container_name: db_schema
        environment:
            MYSQL_ROOT_PASSWORD: 'whatever'
            MYSQL_DATABASE: 'mytable'
            MYSQL_USER: 'user'
            MYSQL_PASSWORD: 'password'
        networks:
            - app-network

networks:
    app-network:
        driver: bridge
@williamdes
Copy link
Member

@williamdes williamdes commented Sep 30, 2019

@iquito so you solved the issue ?

@williamdes williamdes added the question label Sep 30, 2019
@iquito
Copy link
Author

@iquito iquito commented Oct 1, 2019

Yes, by not defining working_dir. If you define working_dir (to something other than the default), then it will not work, because phpmyadmin will be copied to that working_dir but Apache will not use it.

I did not close this issue because this seems unintended: either working_dir should be ignored, or Apache should also use working_dir.

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

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.