Uploads failing with no reason

Claudio asked:

I’ve been trying to discover a problem on my webserver which simply makes the upload of files fail. I also created a simply php script to test the upload, and when uploading it fails but I don’t get any sort error or log message. The file I’ve been testing with has 86mb, I already increased the following php settings related with uploads and restarted apache:

memory_limit 1024MB
post_max_size 512MB
upload_max_filesize 256MB

Regardless of any change I’ve been making, the problem persists, uploads only work for small files. I’m using php7.3, apache 2.4.39 and CentOS 7.6.

Another test I’ve done was changing upload_tmp_dir to a custom folder, and I was able to check that a temporary file is created while the file is being uploaded until it somehow fails and the file is deleted. Also tried disabling SELinux but the result was the same.

My answer:

Check your Apache configuration for the directive LimitRequestBody. By default this is 0, allowing unlimited upload sizes, but it may have been customized. Upload size limits must be sufficient in both Apache and PHP configurations.

View the full question and any other answers on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.