Thursday 24 September 2020

Apache RewriteMap prg using fopen('php://stdin', 'r') not working over HTTPS

I've set up a RewriteMap using prg which calls a php script, like this:

#!/usr/local/bin/php
<?php

        $stdout = fopen('php://stdout', 'w');
        $stdin  = fopen('php://stdin', 'r');
        
        stream_set_write_buffer($stdout, 0);
        
        while(!feof($stdin)):
            
            $input  = fgets($stdin);
            $time   = date('g:i:s');
        
            file_put_contents('rewrite.log',$time." - ".$input,FILE_APPEND);
            
        endwhile;
?>

It works correctly over HTTP, but over HTTPS no input is returned.

I'm using Apache 2.4, PHP 7.2 and have confirmed that OpenSSL is installed.

What could be going on here?



from Apache RewriteMap prg using fopen('php://stdin', 'r') not working over HTTPS

No comments:

Post a Comment