New PHP Application

I created new application creating HTTP integration. the simple PHP script below did not for uplink script.I checked to make sure that script is accessible thru browser in apache access.log. However, file_put_contest are not working and temp file is not created.

<?php
        //header("Content-type: application/json");
        header("Content-type: text/html");
        $json = file_get_contents("php://input");
        print "<html><body>";
        print "<h2>JSON ".$json."</h2><br/>";
        print "<h2>HELLO</h2><br/>\n";
        file_put_contents("/tmp/TXT.txt","HELLO\n");
        file_put_contents("/tmp/TXT.txt", $json);
        print "</body></html>";
?>

using /tmp directory isn’t good idea
try to use another one. (/var/tmp/ or the same directory in which your php script is located)