title: PHP proxy only functioning at certain URLs
body: <p>I am trying to get around the cross-domain issue involved in hosting Geoserver map layers on one domain and an html file accessing them via OpenLayers WMSGetFeatureInfo on <a href="http://greengeography.org/projects/oregonwild/or_wild_webmap18.html" rel="nofollow">another domain</a>. This works fine, of course, when the <a href="http://50.112.123.161:8080/geoserver/www/or_wild_webmap5.html" rel="nofollow">html file is on the same domain</a> (click on a polygon, you should get a popup with that feature's info). I've seen a few similar posts on this site and others, but none solved this problem:</p>
  
  <p>When I submit a URL that includes my php proxy, such as <a href="http://greengeography.org/projects/oregonwild/curlproxy3.php?url=http://www.google.com" rel="nofollow">http://greengeography.org/projects/oregonwild/curlproxy3.php?url=http://www.google.com</a>, it works fine. But when I try any URL from my Amazon EC2 site (running Linux and Tomcat 6 btw), such as <a href="http://greengeography.org/projects/oregonwild/curlproxy3.php?url=http://50.112.123.161:8080" rel="nofollow">http://greengeography.org/projects/oregonwild/curlproxy3.php?url=http://50.112.123.161:8080</a>, I get a 0 as a result. And that IP address is accessible just fine <a href="http://50.112.123.161:8080" rel="nofollow">on its own</a>. </p>
  
  <p>Here is my php (I've tried the <strong>get_file_contents</strong> method as well):</p>
  
  <pre><code>&lt;?php
  
      $url = $_REQUEST["url"];
  
      $curl = curl_init($url);
      curl_setopt($curl, CURLOPT_URL, $url);
      curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
      curl_setopt($curl, CURLOPT_HTTPHEADER, array(
              'POST HTTP/1.0',
              'Content-type: text/xml;charset="UTF-8"',
              'Accept: text/xml',
              'Cache-Control: no-cache',
              'Pragma: no-cache'
          ));
      $theData = curl_exec($curl);
      curl_close($curl);
  
      echo $theData;
  
  ?&gt;
  </code></pre>
  
  <p>And my OpenLayers/GeoExt: </p>
  
  <pre><code>OpenLayers.ProxyHost = "curlproxy3.php?url=";
  
  var featureInfo = new OpenLayers.Control.WMSGetFeatureInfo({
           url: 'http://50.112.123.161:8080/geoserver/OR_wild_wkspc/wms',
           queryVisible: true,  
           FEATURE_COUNT: 1,
           exceptions: "application/vnd.ogc.se_xml",       
           layerUrls: ["http://50.112.123.161:8080/geoserver/gwc/service/wms"],
              eventListeners: {
                  getfeatureinfo: function(e) {
                       new GeoExt.Popup({
                       title: "Feature Info",
                       width: 400,
                       autoHeight: true,
                       autoScroll: true,
                       queryVisible: true,
                       map: map,
                       lonlat: mapPanel.map.getLonLatFromPixel(e.xy),
                       html: e.text
                      }).show();
                  }
              }
      });
  
  mapPanel.map.addControl(featureInfo);
  featureInfo.activate();
  </code></pre>
  
  <p>Also, and apologies as this is a bit of a side issue that I can't even address until I get the proxy working, but when I click on a feature on the main site, I receive the following: <strong>Uncaught TypeError: Cannot read property 'x' of null</strong>. Have not been able to figure that one out either. </p>
  
  <p>Any thoughts? I'm thinking it's a problem with Tomcat or some setting in my Linux/Amazon environment and not the php as I have no problem with the proxy pointing to other sites. Oh and I have very little php experience, so please dumb it down if possible. Thanks!</p>