Skip to content

php:7.4-apache #587

Answered by mlocati
adil-azmy asked this question in Q&A
Jun 10, 2022 · 2 comments · 2 replies
Discussion options

You must be logged in to vote
  1. I created a Dockerfile like the one you provided:
    FROM php:7.4-apache
    
    ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/
    
    RUN \
        # Set -ex and chain commands using ';' instead of '&&'.
        set -ex; \
        \
        apt-get update; \
        \
        chmod +x /usr/local/bin/install-php-extensions; \
        \
        install-php-extensions mysqli
  2. I created an image with: docker build -t test:latest .
  3. I created a directory on my PC with an index.php file containing <?php phpinfo();
  4. I launched it with
    docker run --rm -p 8000:80 -v path/to/the/test/directory:/var/www/html test:latest
  5. I browsed to http://localhost:8000, and here's w…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@adil-azmy
Comment options

Comment options

You must be logged in to vote
1 reply
@adil-azmy
Comment options

Answer selected by adil-azmy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants