0

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.

Claudio
  • 111
  • 3

2 Answers2

1

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.

Michael Hampton
  • 244,070
  • 43
  • 506
  • 972
1

The problem was being caused by the reqtimeout_module, adding the following code to /etc/httpd/conf/httpd.conf fix the problem.

<IfModule reqtimeout_module>
    RequestReadTimeout header=20-40,MinRate=500 body=20,MinRate=500
</IfModule>
Claudio
  • 111
  • 3