![Docker compose update php.ini](/_gatsby/image/2acce825ab35b1ce8737fd0520b3b8d5/2287df8df39ba0a889071d83b476d068/Paint-app-with-Dual-axis-joystick-support-using-ESP32-2.png?u=http%3A%2F%2Fwp.docker.localhost%3A8000%2Fwp-content%2Fuploads%2F2020%2F10%2FPaint-app-with-Dual-axis-joystick-support-using-ESP32-2.png&a=w%3D200%26h%3D113%26fm%3Dpng%26q%3D75&cd=b77570066538e52682237316a7e48259)
Docker compose update php.ini
4 years ago, October 24, 2020
Reading time: 1 mins
How to configure the php.ini
in your docker container?
Here is how you can update your config files like php.ini
, httpd.conf
, php-fpm.conf
, .htaccess
, etc in a docker container through the host filesystem.
On the root folder of your project where your docker-compose.yml
is, add a new file to replace some config file, in your PHP container.
Then on your docker-compose.yml
file add a volume to your PHP container
volumes:
-./<your_local.ini>:/etc/path/to/the/ini/you/want/to/replace/with.ini
Then restart your docker container with --build
flag on
docker-compose up --build
Simple docker-compose YAML file
version: "3"
services:
php:
image: php:8.2-apache
volumes:
- ./html:/var/www/html:cached
- ./config/php.ini:/usr/local/etc/php/php.ini
ports:
- "8000:80"
I have created a short video explaining how to create a simple PHP project in Docker and update the PHP.INI file to update MAX_EXECUTION_TIME config.