无法在 localhost 上使用 Zend_Rest_Client 连接错误
我正在使用 Zend_Rest_Client
连接 Zend_Rest_Server
,一切似乎都正常,但是当我尝试从服务器 get()
时,我收到此错误:
Zend_Http_Client_Adapter_Exception: 无法连接到 tcp://localhost:80。 错误#10060:A 连接尝试失败,因为 关联方未妥善 一段时间后回复,或 建立的连接失败,因为 连接的主机未能响应。 在 C:\www\zf_1_72\library\Zend\Http\Client\Adapter\Socket.php 第148行
是代码,我使用它,
$client = new Zend_Rest_Client('http://localhost/my_application/api/index/');
$client->auth($key);
$result = $client->get();
谢谢您的建议
I am using Zend_Rest_Client
to connect Zend_Rest_Server
, everything seems to be alright, but when I try to get()
from the server I recieve this error:
Zend_Http_Client_Adapter_Exception:
Unable to Connect to
tcp://localhost:80. Error #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.
in
C:\www\zf_1_72\library\Zend\Http\Client\Adapter\Socket.php
on line 148
here is code, which I use
$client = new Zend_Rest_Client('http://localhost/my_application/api/index/');
$client->auth($key);
$result = $client->get();
thank's for any advice
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
此帖子表明问题可能与“localhost”名称有关 - 尝试使用
127.0.0.1
代替。This thread suggetss the issue may be with the 'localhost' name - try using
127.0.0.1
instead.