NextCloud 17.0.0 on Docker Container where is the php.ini file?


I pulled a docker image nextcloud:latest from Docker Hub apache image and created a nextcloud deployment behind a Nginx Reverse proxy /LB.

All works ok.

I am trying to increase the upload file size and cannot find the php.ini where I should chaneg the parameter upload_max_size= 200M.

I cannot find the documentation that tells me where the PHP is deployed in the container

I found that in /usr/local/etc/php/conf.d there are a bunch of files like:
. . . etc

but I can where to find the parameter.

Please be so kind of provide me some guide to where to find all the php files.


you create a php.ini with your desired parameters somewhere on your host.


and map it to /usr/local/etc/php/php.ini inside your container.

I logged in to the container that run nextcloud and created a file named php.ini in the folder /usr/local/etc/php just to test before putting it on a volume.

The php.ini has the following parameter as you suggested:
upload_max_filesize = 2048M
post_max_size = 2048M
max_execution_time = 200

In the folder I also have:


and restarted the container and try to upload a 50M file but this it failed again.

Beside I would like to know where is the file currently used for configure php because I want to be sure first that nextcloud container config is ok and then if the issue persist then I can go the the nginx proxi container to check there.

Any other suggestion?

nginx has a paramter: client_max_body_size 10G;
and may be apache too. not sure about this.

Thanks so I could disregard the possibility of an issue at the Nginx proxy level.

Now where is the php picking up configuration in my nextcloud container?

I figure that the files

are there for renaming to php.ini but they are not renamed by default so there must be another php.ini somewhere that is currently used.

It seems to me that the folder /usr/local/etc/php/conf.d is where php look for .ini files, I see there a bunch, each with different parameters.

I tried inserting my parameter upload_max_filesize on one of them but that didn’t work either.

talking about this docker image

/usr/local/etc/php/conf.d/ should be the place where all php-*.ini file goes.

if you put this into a file in your web root and browse to this file, you’ll see your php config.

phpinfo ();

thanks Reiner for your help.

The phpinfo is something I can’t use because any post to the html home folder get redirected to nextcloud.

But I agree that the place for having any php config file so I just move mine there and restarted the container but no solution.

I don’t see any indication in the log file.

Just to make sure I test with small files and get no error so no doubts that is the file size.

Now that I have the php.ini in the right place I don’t know what else to do.

Any suggestion?

you could just insert one line into index.php. (should work. as far as i remember.)

phpinfo ();

 * Your webserver seems to be not configured to use PHP or PHP is not installed.
 * Please contact your administrator or follow our documentation:

Hey This was a good one !!!

I did that and was able to get php configuration info and verified that my .ini file was parsed and also that the upload_max_filesize is 2048M (2GB) is correct as put it.

So I figure that next stop is Nginx right?

I will focus on that and check the parameter you gave me before.

also a good source:

Thanks Reiner for the link.

I edited the nginx configuration file in the proper container at
and inserted the parameter

http {

client_max_body_size 2048M;

and voila !! it start to work and now I can upload big files to nextcloud 17.

Thanks so much for your support. I owe you one!!

Just for the perfection:

$ docker ps
585xxxb09xx0        jwilder/nginx-proxy:alpine
$ docker exec -it 585xxxb09xx0 bash
# vi /etc/nginx/nginx.conf

http {

client_max_body_size 2048M;

Otherwise thanks a lot for all above.