I'm trying to make a file upload script and I've been struggling with this problem for a while.
I've read and tried all the SO answers related to this, but to no avail.
Here is what I tried in php. ini:
file_uploads = On
upload_max_filesize = 100M
post_max_size = 100M
memory_limit = 100M
In Apache I have:
<Directory /var/www/uploads>
php_value upload_max_filesize 10G
php_value post_max_size 10G
</Directory>
I might have tried something else that doesn't come to mind right now.
I also want to mention that everything under 8MB is uploaded without a problem. Also timeout isn't a problem either as the upload fails in just a few seconds.
P.S. I'm using Cloudflare. Could it be that this is what's blocking my upload?
sometimes excute time occur problem, use set_time_limit(0);
or
Check the php.ini ini_set('max_execution_time', 0); //0
Confirm your location of PHP.ini by creating a test.php file with phpinfo() in it.
Next, check your Apache (LimitRequestBody directive*) and php.ini (upload_max_filesize) limits, so normally those are set higher. Value is in bytes.
Apache 2.0 has a default upload size of 524288,found in the php "include file" /etc/httpd/conf.d/php.conf, to override this value, place the following directive in your httpd.conf virtual host directive:
(This example limits request body to 30M)
Apache 1.3 does not have this default, and so you normally have to change only the php.ini (upload_max_filesize,post_max_size) values and the config.ini (maxuploadfilesize) value.
Finally, check RequestReadTimeout setting. More at https://serverfault.com/a/260389