It seems that you are interested in installing and configuring Apache, PHP, MySQL, and phpMyAdmin using Docker. We will answer your questions.
Is this configuration file correct?
Yes, the docker compose file you provided is configured correctly.
The article uses Dockerfile and I don’t want that. How can I install the following extensions without
needing a Dockerfile ?
If you prefer to install extensions without using Dockerfile, it is limited except to directly use an image that
contains PHP extensions or create a custom image.
If additional extensions are needed, a common approach is to build a custom image using Dockerfile. It is
difficult to dynamically add extensions without Dockerfile.
Why is PhpMyAdmin only linked to MySQL and not PHP?
phpMyAdmin is a web-based MySQL database management tool that connects directly to the MySQL server.
It does not connect to PHP itself, but interacts with MySQL by performing database operations through PHP
code.
Hello,
Thank you so much for your reply.
1- The Dockerfile of the article is as follows:
# Use an official PHP runtime
FROM php:8.2-apache
# Enable Apache modules
RUN a2enmod rewrite
# Install any extensions you need
RUN docker-php-ext-install mysqli pdo pdo_mysql
# Set the working directory to /var/www/html
WORKDIR /var/www/html
# Copy the source code in /www into the container at /var/www/html
COPY ../www .
I use httpd:latest image and added the following command in the YAML file:
Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: exec: "a2enmod": executable file not found in $PATH: unknown
It seems that this problem is related to the image that I am using. How can I find out which commands an image supports?
2- About PhpMyAdmin, my question was that this management tool uses the PHP programming language, so it must be linked to PHP. Isn’t it?