PHP code example of hoa / fastcgi

1. Go to this page and download the library: Download hoa/fastcgi library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

hoa / fastcgi example snippets




echo 'foobar';

$fastcgi = new Hoa\Fastcgi\Responder(
    new Hoa\Socket\Client('tcp://127.0.0.1:9000')
);
var_dump($fastcgi->send([
    'REQUEST_METHOD'  => 'GET',
    'REQUEST_URI'     => '/',
    'SCRIPT_FILENAME' => __DIR__ . DS . 'Echo.php'
]));
// string(6) "foobar"