Edit php ini docker
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. Show dockercompose.ymlChange GitHub – Project
Create new Dockerfile in ./apache/php/php8.1/ directory. Inside Dockerfile type:
DockerfileCreate your custom Dockerfile from Apache / PHP image and copy .ini file to with php.ini file with the fallowing command: Create php.ini file
Install new extension in docker apache-php imageInstall new PHP extension using 0and 1
Change existing settings in docker image – php.ini file.Modify existing settings in php.ini.
Add new / non-existing settings to docker image – in to php.ini file
Create bash script …Now you know how to change setting in docker image for apache-php. You might think that it would be nice to create a bash script that will check if the php.ini setting is set, is commented out or should it add a new line to config file and use it instead. This is also what I think. Perhaps in next blogpost we will create such a script, so stay keep reading. Hope this post was helpful, if so leave a comment or let me know if we could improve this post in any way. A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch? |