Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/codeigniter/3.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/5/actionscript-3/6.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(CodeIgniter)中从标头检索端口信息?_Php_Codeigniter_Header_Port_Amazon Elastic Beanstalk - Fatal编程技术网

如何在PHP(CodeIgniter)中从标头检索端口信息?

如何在PHP(CodeIgniter)中从标头检索端口信息?,php,codeigniter,header,port,amazon-elastic-beanstalk,Php,Codeigniter,Header,Port,Amazon Elastic Beanstalk,我试图从PHP中的头请求中获取端口信息。点火器代码是否具体 我试着做: $headers = apache_request_headers(); 端口信息不可用 我们使用亚马逊的弹性豆茎作为服务器。我们被告知: EC2负载平衡器发送了一个称为“X-Forwarded-Proto”的头,该头根据我们是http还是https而波动 如果我尝试这样做: $headers = apache_request_headers(); $port = $headers["X-Forw

我试图从PHP中的头请求中获取端口信息。点火器代码是否具体

我试着做:

    $headers = apache_request_headers();
端口信息不可用

我们使用亚马逊的弹性豆茎作为服务器。我们被告知: EC2负载平衡器发送了一个称为“X-Forwarded-Proto”的头,该头根据我们是http还是https而波动

如果我尝试这样做:

    $headers = apache_request_headers(); 
    $port = $headers["X-Forwarded-Port"]; 
    echo "X-Forwarded-Port : " . $port;
这给了我一个机会 错误-2012-10-19 00:48:05-->严重性:注意-->未定义索引:X端口

如果您能想到如何从标题中获取端口信息,我将不胜感激


提前谢谢

为$\u服务器进行打印,看看会有什么结果
$_SERVER['REMOTE_PORT'] for remote port
$_SERVER['SERVER_PORT'] for server port