How to configure PHP upload max filesize

Hi hosters,

It should be quite usual situation when you need to adjust your server’s php upload limits (or other parameters). I had some experience with apache and remember finding many different instructions how to do it, some of which worked and some didn’t. I don’t want to experiment again on production server now.

Maybe it is a good idea to ask for recommendations here and leave them in written for others.

So, I expect there should be two basic use cases: global PHP settings for all yunohost needs (we probably shouldn’t even touch it, right?) and per-app settings. So, what is the safe way to tune PHP in Yunohost?

Using YunoHost 4.3.4.1 (stable)

So I managed to tweak it, but not sure if it was the proper way.

Here’s how:
php settings is controlled in /etc/php7.3/fpm/php.ini (use the corresponding php version)
For large uploads you need two lines:

upload_max_filesize = 100M
post_max_size = 100M

Strangely enough, the problem I had with webtrees persisted - I still couldn’t upload anything bigger than 1MB

So I edited the /etc/nginx/nginx.conf:

    http:

     http {
     ...
     client_max_body_size 100M;
     }

It solved the problem.

I still have no clue how these settings work together and why other apps can handle large uploads. But I hope this helps someone.

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.