I have problem with my web server hosted in php:8.0-apache
docker container, always returning status code 200, even if it's set to different value. Same code outside of container works correctly
my php.ini
file is:
log_errors=On
error_log=/dev/stderr
and php code is:
... some code ...
http_response_code(400);
exit;
but I receive response:
HTTP/1.1 200 OK
Any ideas what's wrong with my setup?
edit: docker file:
FROM php:8.0-apache
RUN echo "<?php echo '{some json content}'; http_response_code(400); exit; ?>" >> /var/www/html/index.php
COPY php.ini /usr/local/etc/php/