title: How to fix "Connection #0 to host left intact" in PHP"?
body: <p>I am trying to access a PHP file (that contains redirect instructions) through Windows cmd using ideviceactivation from libimobiledevice. The file is hosted with GearHost. Before I started getting this error, I would specify the directory of the file in the command prompt and ideviceactivation would access the PHP file and redirect to the specified URL, where another PHP file is hosted and contains actual instructions for the program. However, I can no longer successfully get the redirect file to access the real file without the following error:</p>
  
  <pre><code>   Connection #0 to host (redirect file host) left intact
     error_message: Failed to connect to (actual file host) port 80: 
     Timed out&lt;br&gt;error_no: 7
  </code></pre>
  
  <p>It works perfect if I specify the directory of the real PHP file through the command prompt, but thats not my objective.</p>
  
  <p>Here is the section of my code for the redirect. It uses curl to access the second file:</p>
  
  <pre><code>   $_POST['activation-info']  = $data;
  
     $myurl = "http://website.com/secondphpfile";
  
     $ch = curl_init(); 
  
      curl_setopt($ch, CURLOPT_URL , $myurl ); 
      curl_setopt($ch, CURLOPT_RETURNTRANSFER , 1); 
      curl_setopt($ch, CURLOPT_VERBOSE, 0);
      curl_setopt($ch, CURLOPT_HTTPHEADER, array("Expect: 100-continue", "Accept: */*", "Content-Length: ".strlen($_POST['activation-info']), "Content-Type: multipart/form-data; boundary=------------------------0edb00d9406ed52e--------------------------0edb00d9406ed52e"));
  
  
      curl_setopt($ch, CURLOPT_USERAGENT , "iOS Device Activator 
             (MobileActivation-20 built on Jan 15 2012 at 19:07:28)" );
      curl_setopt($ch, CURLOPT_POST , 0); 
      curl_setopt($ch, CURLOPT_POSTFIELDS , $_POST['activation-info']); 
  
      $xml_response = curl_exec($ch); 
  
      if (curl_errno($ch)) { 
  
          $error_message = curl_error($ch); 
          $error_no = curl_errno($ch);
  
          echo "error_message: " . $error_message . "&lt;br&gt;";
          echo "error_no: " . $error_no . "&lt;br&gt;";
      }
  
      curl_close($ch);
  </code></pre>
  
  <p>This code is supposed to redirect to the file at the specified $myurl but it returns the error above. Any suggestions would be awesome!</p>