开发者社区> 问答> 正文

为什么出现 400 Bad Request 用的是ngix? 400 报错

为什么出现 400 Bad Request 用的是ngix? 400 报错

换了个php环境?

<?php
	//error_reporting(0);
	$fp=fsockopen("127.0.0.1",80);     //打开数据流
	if(!$fp){
		echo "unable to open";
	}
	else{
		fwrite($fp,"get/http/1.0rnrn");
		stream_set_timeout($fp,2);
		$res = fread($fp,2000);
		$info = stream_get_meta_data($fp);
		fclose($fp);
		if($info['timed_out']){
			echo 'connection time out!';
		}
		else{
			echo $res;
		}
	}
?>

为什么出现400 Bad Request nginx/0.8.52 错误?

展开
收起
爱吃鱼的程序员 2020-06-03 13:54:48 671 0
1 条回答
写回答
取消 提交回答
问答地址:
问答排行榜
最热
最新

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载
http://www.vxiaotou.com