Strategic IT Consulting and Implementation Services

Nextcloud PHP Settings

Kind of a random game over the years to optimize PHP 7.x and 8.x for Nextcloud and there are a variety of disclaimers on what you might think about doing for your specific instance, etc. based on server capacity and size of files, apache or nginx, and all that stuff. Not to mention the ambiguity around PHP, PHP-FPM, and whether you are using caching or not and all those separate possible config settings that can cause hours of fun to mess with.

Anyway, here is what I am currently running now after finally stepping away from PHP 7.4.x and into PHP 8.1 w/PHP-FPM on Debian. Again, YMMV, but just putting this out there for others as the search for something definite is a pretty tough effort elsewhere.

Your paths may vary and there are numerous connected/overlapping php.ini files so that is a challenge as well because some areas of php are broken-out into sub directories by version, etc. Check your to try and get a handle on where everything is for you.

Here are some files and settings of note I have been messing with and am somewhat happy with now on Nextcloud 25.03 and PHP 8.1.x as of January 2023. Running on a 32gb RAM Intel i7 hardware setup. Again, after many, many, many, years on Nextcloud and running PHP in a variety of apps, this is all pretty much guessing at this point. No real opinion but hope this might help you in some way as you explore your own personal journey with all of this.


memory_limit = 4G
post_max_size = 0
upload_max_filesize = 50G



pm = dynamic
pm.max_children = 200
pm.start_servers = 20
pm.min_spare_servers = 12
pm.max_spare_servers = 30

About the author

Jonathan Mergy

Add comment

Strategic IT Consulting and Implementation Services