我一直关注this tutorial这一切似乎都在我的本地计算机上运行但是我在生产服务器上尝试它,我发送新博客帖子的页面很快当它到达$socket->connect("tcp://localhost:5555");
部分时,它会返回500/502错误。
使用apache2和PHP处理FastCGI时,apache日志说:
(104)Connection reset by peer: mod_fcgid: error reading data from FastCGI server, referer: http://website/_test/send.php
如果我将其切换到Apache模块,则会出现以下错误:
upstream prematurely closed connection while reading response header from upstream
php错误日志文件中没有任何内容,仅在apache日志中。
EDIT1:使用来自https://www.websocket.org/echo.html&#34的脚本检查套接字;创建自己的测试"部分。
以
回复CONNECTED
SENT: WebSocket rocks
RESPONSE: [0,"166422729657a4668eedc90747239488",1,"Ratchet\/0.3.5"]
DISCONNECTED
EDIT2:我认为它可能与nginx有关。从它的外观来看,我们的生产服务器在内部使用apache,然后使用nginx进行外部连接(我不是那个设置它的人,因此是猜测)。
EDIT3:从proxy_error_log记录:
2016/08/05 14:27:22 [error] 19214#0: *155952 upstream prematurely closed connection while reading response header from upstream, client: 217.**.**.***, server: my.domain.name, request: "POST /_socket/send.php HTTP/1.1", upstream: "http://78.***.***.**:7080/_socket/send.php", host: "my.domain.name", referrer: "http://my.domain.name/_test/chat.php"