Docker Community Forums

Share and learn in the Docker community.

How to get access to php.ini file

(Monterey) #21

Hi @gforghetti

The added data to the YAML file is not sufficient, as the new limit for uploads set as

RUN touch /usr/local/etc/php/conf.d/uploads.ini \
    && echo "upload_max_filesize = 10M;" >> /usr/local/etc/php/conf.d/uploads.ini

which you introduced above is not taking care of the /usr/local/etc/php/conf.d folder.

Note that I am not nitpicking here - my intent is to finish this discussion in a way that will provide the good solution for anyone who decides to use Docker to install wordpress.

(Gary Forghetti) #22

Try increasing the value to what you think you want the maximum to be for your Wordpress site.
Below is for 1024M. I’m pretty sure the value has to be in megabytes.

upload_max_filesize = 1024M

(Monterey) #23

I believe that you misunderstood my today’s remark, so I will restate it this way: the file
/usr/local/etc/php/conf.d/uploads.ini should also be persisted the same way as the folder /var/www/html

Making sense?

(Gary Forghetti) #24

I think for the /usr/local/etc/php directory, the better wording is to have it exposed as a volume so you can do a bind mount and specify overrides. Nothing in that directory is modified at run time so no need for you to define it on an external volume and make it persistent.

You can open a GitHub issue here ->

Tell them you want the Docker Official Wordpress Docker Image to expose the /usr/local/etc/php directory as a volume mount point so you (and other users) can bind mount your own customization files at container run time.

(Monterey) #25

Very good observation (Nothing in that directory is modified at run time), @gforghetti :clap:

I stand corrected and grateful for your time spent helping me to resolve my problem. The good side-effect is that this solution will help many other folks that undoubtedly follow.

I created this issue at the suggested GitHub repo and will update this thread once that issue gets resolved.

(Monterey) #26

The final thread with the solution in the form of the YAML file for the composer is here.

(Gary Forghetti) #27

Yes, that looks good and no need for you to build a custom docker image. I had tried that previously and it did not work for me. I probably had a typo on the target side of the mount.

I’ll give that a try myself.

(Gary Forghetti) #28


Hi, I tried the solution that was identified in the GitHub Issue response and it worked for me too.


(Monterey) #29

@gforghetti can you do a little magic and make the reference to this solution appear in the original article ( that led me to get in touch with you and then with the wordpress library folks at ?