Question

I'm working on creating a photo upload form and I'm running into some trouble. Essentially, a user fills out some basic demographic data, checks a media release, selects a photo, and uploads it. I then use a few nested if statements to validate that it's the correct photo size, type, etc.

At times it works just fine, but with certain photos I've been getting this error:

PHP Warning: POST Content-Length of 11310075 bytes exceeds the limit of 8388608 bytes

Followed by a bunch of

PHP: Notice: Undefined Index

for each of elements in my $_POST array. I did some digging with phpinfo() and found that memory_limit is set to 128M...so I'm confused as to what's going wrong.

I'm using MODX, Apache/2.2.25

Thanks for your help!

Was it helpful?

Solution

The issue is not about memory, but max upload/post data limit. Please check you phpinfo() for:

post_max_size

upload_max_filesize

These values should be increased. This can be done by editing php.ini file, or by set_ini() function.

OTHER TIPS

You can set unlimited memory usage with this code. ini_set('memory_limit', '-1');

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top