0

Via PHP, I output a 400 Bad Request header along with a message in the body of the response. Yet Apache keeps on blocking it and returns a 500 Internal Error.

I believe its an Apache issue - not a PHP one. Can someone tell me how to let those pass through?

Martin Drapeau
  • 1,484
  • 15
  • 16

1 Answers1

0

Hot damn! Turns out the issue was PHP after all. PHP-FPM its a little tricky. The solution was to send the header this way:

header("X-PHP-Response-Code: $code", true, $code);

As explained here: PHP: How to send HTTP response code?

Thanks Stackoverflow!

Community
  • 1
  • 1
Martin Drapeau
  • 1,484
  • 15
  • 16