Docker-Compose won't volume my php.ini file

大兔子大兔子 提交于 2019-11-30 22:25:57

I found the answer, put a file called custom.php.ini in the config directory (if you are following my directory structure).

Set the volumes like this in my example...

volumes:
            - ./web:/var/www
            - ./config/custom.php.ini:/etc/php5/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

This removes the containers and their cache files. PHP only loads the configuration file once at bootup and the other files so changing the php.ini or the custom file after requires this docker-compose down to force the change.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!