Linux, FreeBSD, Juniper, Cisco / Network security articles and troubleshooting guides
https://forum.ivorde.com/

Nginx + php-fpm increase upload_max_filesize and other php values per vhost
https://forum.ivorde.com/nginx-php-fpm-increase-upload-max-filesize-and-other-php-values-per-vhost-t1151.html
Page 1 of 1

Author:  mandrei99 [ Mon Jan 02, 2012 9:04 am ]
Post subject:  Nginx + php-fpm increase upload_max_filesize and other php values per vhost

Recent version of PHP support the PHP_VALUE command for fcgi processes. This means that php ini directives can be configured for each Nginx virtual host individually.
The trick is that multiple values need to be set in one "fastcgi_param PHP_VALUE" directive with a newline character as separator otherwise only the last one will be used by the php process.







Configure php upload_max_filesize from nginx fastcgi parameters


The upload_max_filesize php ini configuration sets the maximum size of an uploaded file.
Example of increasing PHP's upload_max_filesize ini setting via Nginx web server:
Code:
    location ~ \.php$ {
      fastcgi_param PHP_VALUE "upload_max_filesize = 50M \n post_max_size=51M";
}


Below example is INCORRECT:
Code:
    location ~ \.php$ {
      fastcgi_param PHP_VALUE "upload_max_filesize = 50M";
      fastcgi_param PHP_VALUE "post_max_size=51M";
}

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/