title: $http.post from angular reaches php, but response is not received back in angularjs
body: <p>I'm having this weird issue where you already did something thousands of time but this time won't work. I've been on it for two days and can't fix it.</p>
  
  <p>So my code is very simple :</p>
  
  <p>js : </p>
  
  <pre><code>$http.post('datas/test.php', data)
      .success(function(response) 
               console.log(response);
       })
      .error(function() {
               console.log("error");
       });
  </code></pre>
  
  <p>test.php :</p>
  
  <pre><code>&lt;?php
  $user=json_decode(file_get_contents('php://input'));
  echo json_encode($user);
  ?&gt;
  </code></pre>
  
  <p>When I do a console.log(data) before the $http.post it's containing an object with two fields which are both strings but the console.log(response) give me a null so every time I try to access a variable like $user->something it gives me an error.</p>
  
  <p>I'm having a second issue that is really weird too : when I run my app and call the $http.post it gives me all the errors I said before, but if I try an other time, the $http.post won't call at all until I reboot the server (it's giving me a bad gateway).</p>
  
  <p>I tested many things like changing the way I call my file :</p>
  
  <pre><code>$http({
      method: 'POST',
      url: 'datas/test.php',
      data: data,
      headers: {'Content-Type': 'application/x-www-form-urlencoded'} // Or 'application/json'
  });
  </code></pre>
  
  <p>but this is giving me exactly the same behavior.</p>
  
  <p>Thank you in advance for helping me out and have a good day ! ;)</p>
  
  <p>PS: I'm using PHPStorm in case it has anything to do with the server reboot thing.</p>