Page 1 of 1

PHP attachment file size limit??

Posted: Sat Nov 08, 2008 2:12 am
by cah
I was trying to attach some pictures from last week's JDRF walk but some of the files failed to upload to phpbb3.

It complained:
The image file you tried to attach is invalid.
After a few tests, I found it was caused by file size.
For those over 2 MB pictures, it will show the above message.

I have set the max attachment file size to be unlimited but it still bombs out when files are over 2 MB.

After reading some of the posts on the internet, this is not a limitation of PHPBB3.
Instead, it is the limit of PHP.

Try to modify the following entries in /usr/local/lib/php.ini:

Code: Select all

; Maximum allowed size for uploaded files.
upload_max_filesize = 5M (it was set to 2M)
After changing the upload max filesize, I was able to upload files larger than 2 MB.

Re: PHP attachment file size limit??

Posted: Sun Mar 01, 2009 11:35 pm
by cah
Increase the max upload file size from 5M to 10M

Note: a restart of Apache is needed to take effect

Re: PHP attachment file size limit??

Posted: Sat Aug 01, 2009 3:03 pm
by cah
There are two size settings in php.ini:

Code: Select all

; Maximum size of POST data that PHP will accept.
post_max_size = 8M

; Maximum allowed size for uploaded files.
upload_max_filesize = 10M
One classmate tried to upload a 9 MB file and failed.
It is apparently limited by post_max_size.
However, I never touched this setting before.
All I changed was upload_max_filesize from 2MB to 5MB to 10MB.

Maybe these two settings should match.