YunoHost-Apps / dolibarr_ynh

Dolibarr ERP & CRM is a modern software to manage your organization's activity. This is an integration of Dolibarr in YunoHost
https://www.dolibarr.org/
GNU Affero General Public License v3.0
12 stars 18 forks source link

memory limit (413 Request Entity Too Large) #33

Closed farvardin closed 3 years ago

farvardin commented 4 years ago

hello,

when uploading a PDF (invoice) bigger than 1 Mb, I get a "413 Request Entity Too Large" error in nginx. If I upload a PDF under 1 Mb, it works fine.

I don't know which file is responsible for this. In /etc/php/7.0/fpm/pool.d/dolibarr.conf I have:

php_admin_value[upload_max_filesize] = 30M

which should allow for a 30 Mb limit if I understood well.

I've also increased those values:

php_admin_value[memory_limit] = 62M php_admin_value[upload_max_filesize] = 60M php_admin_value[post_max_size] = 60M

I've also modified the dolibarr setting to limit files to 16 Mb instead of 8 Mb. But it's still the same, I get the 413 error.

So it's not a problem with php, but rather with nginx.

I've found in this file:

/etc/nginx/conf.d/myhostname.tech.d/dolibarr.conf

   # Common parameter to increase upload size limit in conjunction with dedicated php-fpm file
  # client_max_body_size 50M;

client_max_body_size was commented. I don't know how much is the default (I suppose 1 Mb), but maybe it would be better to increase this value by default? Some pdf to import can definitely be more than 1 Mb.

After I've uncommented the entry, I could upload a 4 Mb PDF!