#AskFedi #PHP When using php-fpm and you've set a ErrorDocument handler in Apach...
Stephen Borrill @sborrill@justfollow.me.uk
When using php-fpm and you've set a ErrorDocument handler in Apache, it appears that you cannot change the HTTP response code from 404 in the handler script
.htaccess:
ErrorDocument 404 /404.php
404.php:
<?php
http_response_code(200);
echo "<html><body>Hi</body></html>";
# curl -I --silent https://test.domain.uk/nothere | head -1
HTTP/1.1 404 Not Found
Without FPM/FastCGI:
# curl -I --silent https://test.domain.uk/nothere | head -1
HTTP/1.1 200 OK
Any hints how to fix this?