第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

nginx下的php做的socket訪問一直超時,環(huán)境是win10

nginx下的php做的socket訪問一直超時,環(huán)境是win10

PHP
動漫人物 2019-03-05 05:07:21
在win10 安裝了php+nginx+mysql,phpinfo打印是正常的,但是在寫了一個簡單的socket的demo后,nginx一直報超時。$fp = fsockopen('localhost',80,$errno,$errstr,10); // 10秒超時if (!$fp) {    echo 'Error Code:'.$errno. '--Error Info:'.$errstr;    die; } $http= ''; $http .= "GET /socket/server.php HTTP/1.1\r\n"; $http .= "Host: localhost\r\n"; $http .= "Connection: close\r\n\r\n"; fwrite($fp, $http); $res = '';while(!feof($fp)) {     $res .= fgets($fp); }echo $res;niginx報錯:2019/03/07 00:46:18 [error] 18316#16624: *1 upstream timed out (10060: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond) while reading response header from upstream, client: 127.0.0.1, server: localhost, request: "GET /socket/client.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "127.0.0.1"求各路大俠指點迷津
查看完整描述

1 回答

?
慕田峪9158850

TA貢獻1794條經(jīng)驗 獲得超8個贊

報文不對吧。
首行之后,應該是接兩組 \r\n ?

你先用 telnet 完成一個正確的報文請求,并得到一個正確的響應之后,再寫代碼吧。


查看完整回答
反對 回復 2019-03-16
  • 1 回答
  • 0 關注
  • 656 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網(wǎng)微信公眾號