Lighttpd and upload_max_filesize

Lighttpd and upload_max_filesize

Default setting for uploading file size in PHP is really small. Usually it’s about 2MB. To increase this limit, you need to change one obvious variable:

upload_max_filesize = 20M

Eventually you can also increase max number of files to upload:

max_file_uploads = 20

But… this is not enough. Because on lighttpd PHP is working as a FastCGI process when you start uploading bigger files, you can get this bad message:

FastCGI-stderr: PHP Warning:  POST Content-Length of 18995464 bytes exceeds the limit of 8388608 bytes in Unknown on line 0

yep.. you ned to increate one last value:

post_max_size = 64M

in your php.ini file (/etc/php5/cgi/php.ini)