Saturday, January 22, 2022

[FIXED] Cannot edit php.ini file in Docker

Issue

I'm trying to edit the php.ini inside Docker, so I need to do docker-compose up. But every time I do docker-compose up, php.ini returns as it was before.


Solution

Better to mount the php.ini from the host, as docker-compose up will terminate the container and will launch a new container which does not container the modified php.ini.

volumes:
   - ./config/custom.php.ini:/etc/php(version)/apache2/conf.d/custom.php.ini

By default the scan directory for extra php files will look in the conf.d directory. These files will overwrite the settings of the main php.ini. I tested this with the asp_tag option turning it Off and On. It works fine as long as you do the following below.

The trick to making this work is to use docker-compose down instead of docker-compose kill

you can check further here and here



Answered By - Adiii

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.