Search code examples
phpdockerini

From where is my php.ini being loaded in php Docker container?


I am running this Docker instance of a linux debian:jessie with php 5.6.

This is part of my phpinfo :

enter image description here

As we can see the php.ini should be located at

/usr/local/etc/php

And this is what I have inside /usr/local/etc/

enter image description here

But there is no php.ini inside it.

I the other hand, I have the php.ini inside

enter image description here

So, from where exactly is my php.ini being loaded?

We dont even have a php process running but the php seems to be ok - being displayed phpinfo in the screen.

enter image description here


Solution

  • Let try it as an answer:

    It does not exist at all, which means php will run the default options.

    Look at your docker file, it starts from a "clean" OS, installs Apache and PHP in it. But it never copies the php.ini file from the PHP installation into /usr/local/etc/php. Actually in lines 31 and 32 it creates the conf.d directory but that is it.

    So I would suggest, at the end of your docker file, add code to copy php.ini-production to /usr/local/etc/php.ini, and edits as required. Or use default options.