If you want to learn how to add a custom php.ini file to your apache-php image, install new extensions and edit configuration settings, stay with me for the next few minutes. As often, the best way to learn is to look on the working example so lets install xdebug and lets set some settings in php.ini file.
dockercompose
.yml
Change image
to build
in dockercompose.yml
GitHub – Project
ersion: '3'
services:
db:
image: mysql:latest
environment:
MYSQL_DATABASE: lamp
MYSQL_USER: admin
MYSQL_PASSWORD: admin
MYSQL_ROOT_PASSWORD: root
MYSQL_ALLOW_EMPTY_PASSWORD: 1
volumes:
- "./sql:/docker-entrypoint-initdb.d"
app-8.1:
# image: php:8.1-apache-buster