test with httpcode in php
<p>I use this code in my application php</p>

<pre><code>$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_HEADER, false); 
curl_setopt($ch, CURLOPT_NOBODY, false); // remove body 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
$data = curl_exec($ch);  
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch); 

if ( $httpCode == 500 ) {
  $result["status"] = 0;
  $result["go"] = 0;
  $result["message"] = "Une erreur s'est produite ";
  echo $_REQUEST["callback"] . "(" . json_encode($result) . ");" ;
  exit;
}

$data   = json_decode($data, true);
$result = array();

$result["status"]  = -1;
$result["go"]      = -1;
$result["message"] = "";
</code></pre>

<p>and when I execute my application I have this message :</p>

<blockquote>
  <p>Une erreur s'est produite</p>
</blockquote>

<p>I want to know in which case httpCode is equal 500</p>
