Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/293.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/EmptyTag/163.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
PHP站点在本地运行良好,在AWS上响应为ERR_EMPTY__Php_Amazon Web Services - Fatal编程技术网

PHP站点在本地运行良好,在AWS上响应为ERR_EMPTY_

PHP站点在本地运行良好,在AWS上响应为ERR_EMPTY_,php,amazon-web-services,Php,Amazon Web Services,我有以下代码,使用一个名为Import.io的web服务,该服务接收URL并返回JSON结构。在我的本地堆栈上,它工作得非常好,但是当我将其部署到AWS时,我只需获得带有代码错误代码:ERR\u EMPTY\u RESPONSE 您是否安装了CURL?如果响应为空,则看起来可能是防火墙问题,您是否检查过是否可以正常点击该框上的URL,并且该框可以访问web? $userGuid = "xxxx"; $apiKey = "xxxx"; function query($connectorG

我有以下代码,使用一个名为Import.io的web服务,该服务接收URL并返回JSON结构。在我的本地堆栈上,它工作得非常好,但是当我将其部署到AWS时,我只需获得带有代码
错误代码:ERR\u EMPTY\u RESPONSE


您是否安装了CURL?如果响应为空,则看起来可能是防火墙问题,您是否检查过是否可以正常点击该框上的URL,并且该框可以访问web?
 $userGuid = "xxxx";
 $apiKey = "xxxx";

 function query($connectorGuid, $input, $userGuid, $apiKey, $additionalInput) {

   $url = "https://api.import.io/store/connector/" . $connectorGuid . "/_query?_user=" .      urlencode($userGuid) . "&_apikey=" . urlencode($apiKey);

   $data = array("input" => $input);
   if ($additionalInput) {
     $data["additionalInput"] = $additionalInput;
   }

   $ch = curl_init($url);
   curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
   curl_setopt($ch, CURLOPT_POSTFIELDS,  json_encode($data));
   curl_setopt($ch, CURLOPT_POST, 1);
   curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
   curl_setopt($ch, CURLOPT_HEADER, 0);
   $result = curl_exec($ch);
   curl_close($ch);

   return json_decode($result);
 }

// Query for tile TimeOutSearch
$result = query("2c2e8949-9b50-447a-bc97-8d10c6a91514", array(
  "webpage/url" => "http://www.timeout.com/london/search?     _source=global&profile=london&_dd=&page_zone=home&keyword=&on=&locationText=&_route=search&_route_params%5Bsite%5D=london&_route_params%5B_locale%5D=en_GB&page=1&type=event&order=popularity&page_size=10",
 ), $userGuid, $apiKey, false);
 var_dump($result);