Can't pass $_POST values to php-cgi
I'm trying to develop a web server with PHP support so I'm doing some little tests with php-cgi, but I can't pass to the interpreter $_POST values.
I've already read this topics, but I couldn't do anything :(:

    - http://stackoverflow.com/questions/7047426/call-php-from-virtual-custom-web-server
    - http://stackoverflow.com/questions/4030147/how-to-pass-post-data-to-the-php-cgi

My source:


    export GATEWAY_INTERFACE="CGI/1.1"
    export SCRIPT_FILENAME="/home/xzhttpd/htdocs/test.php"
    export REQUEST_METHOD="POST"
    export REDIRECT_STATUS=200
    export SERVER_PROTOCOL="HTTP/1.1"
    export REMOTE_HOST="127.0.0.1"
    export CONTENT_LENGHT=23
    export HTTP_ACCEPT="text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
    export CONTENT_TYPE="application/x-www-form-urlencoded"
    export BODY="nick=ciao&psw=ciao1&psw1=ciao1&email=alkz@nigger.it"
    
    exec echo "$BODY" | /usr/bin/php-cgi


I got this:

    PHP Notice: Undefined index: nick in /home/xzhttpd/htdocs/test.php on line 47





 
Can't pass $_POST values to php-cgi
===

I'm trying to develop a web server with PHP support so I'm doing some little tests with php-cgi, but I can't pass to the interpreter $_POST values.
I've already read this topics, but I couldn't do anything :(:

    - http://stackoverflow.com/questions/7047426/call-php-from-virtual-custom-web-server
    - http://stackoverflow.com/questions/4030147/how-to-pass-post-data-to-the-php-cgi

My source:


    export GATEWAY_INTERFACE="CGI/1.1"
    export SCRIPT_FILENAME="/home/xzhttpd/htdocs/test.php"
    export REQUEST_METHOD="POST"
    export REDIRECT_STATUS=200
    export SERVER_PROTOCOL="HTTP/1.1"
    export REMOTE_HOST="127.0.0.1"
    export CONTENT_LENGHT=23
    export HTTP_ACCEPT="text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
    export CONTENT_TYPE="application/x-www-form-urlencoded"
    export BODY="nick=ciao&psw=ciao1&psw1=ciao1&email=alkz@nigger.it"
    
    exec echo "$BODY" | /usr/bin/php-cgi


I got this:

    PHP Notice: Undefined index: nick in /home/xzhttpd/htdocs/test.php on line 47





 