Intent handler remote php post varible is always null

I am trying to call a php on intent recognition, where the php server running on same pi. Below is the profile part.

"handle": {
        "remote": {
            "url": "http://localhost/rhasspy/handle_intent.php"
        },
        "system": "remote"
    },
    "intent": {
        "system": "fsticuffs"
    },

And in the php I am writing the post variable(text) to a file and return some text to play. The returned text is playing correctly by rhasspy, but the post variable is not received at php side, the output file is always null.

<?php
$data = $_POST;

$myfile = fopen("newfile1.txt", "w") or die("Unable to open file!");
 if(!empty($data['text'])){
 	$txt = $data['text'];
    fwrite($myfile, $txt);
 }

 fclose($myfile);
header("Content-Type: application/json");
echo json_encode(array('speech' => array('text' => 'This is the text from php......')));
?>

Is there any addition steps I have to follow.