Search code examples
phpapachefpm

how to enable HTTP request header on Apache 2.4.46


how to enable HTTP request header on Apache 2.4.46 with PHP-FPM 7.4

I'm unable to read custom http header, which run on local with Apache + mode_php

apache_request_headers();

is there any alternative or is there a way to enable it


Solution

  • okay I got like this I have change request header X_PJAX from dash to underscore

    add this in .htacess file
    
    RewriteRule .* - [E=HTTP_X_PJAX:%{HTTP:X_PJAX}]
    

    and then access with prefix HTTP

    $_SERVER["HTTP_X_PJAX"];