Processing too long requests in mod_fcgid

purpose

I want to show a helpful message to my client when the file they are trying to download is too large.

Problem

Right now mine is mod_fcgidthrowing 500 Internal Server Error when I try to send too large a request. I do not know how I can say this error:

  • PHP error when display_errorsit was set to 0
  • request uri for too long
  • incorrect rewrite rules
  • another bad configuration
  • something completely different

If I tell the client “hey, you tried to load a file too large” in the 500 ISE handler, it will also run for all of the above, which makes no sense.

Things i tried

, , ErrorDocument 500 /generic-500.php. $_SERVER $_REQUEST .

:

  • AJAX
  • , 500 ISE

, .

500 ISE PHP , PHP POST?

+4
3

$_SERVER $_REQUEST [ 500 script] .

$_SERVER['CONTENT_LENGTH'], ? "" script , , - .

, ​​ PHP, mod_fcgid , - script ( script, ) ; , , .

ErrorDocument script , , - f.e. FILES, .
, "" 500 script, , , - , , .
, , , , , 500 , , p.i.t.a. , ... , , .

, , , - maxlength , , , . (HTML5 , , HTML5, .)


: HTTP 500 - 413 Request Entity Too Large IMHO . mod_fcgid , .

+1

, , - .

, , FcgidMaxRequestLen . , 500 Server Error , .

+1

What about set_file_buffer ($ f, $ b)? You can set the buffer size there - if you cannot do this work, I would use the output buffer methods to control it ...

0
source

Source: https://habr.com/ru/post/1540785/


All Articles