【发布时间】:2016-02-08 18:15:33
【问题描述】:
我用 Composer 安装了 PHRETS,并且已经能够使用 CMD 终端打印信息并按照文档进行操作。我尝试将所有文件上传到我的网络服务器,但页面超时。
我的错误日志显示如下:
PHP Fatal error: Uncaught exception 'GuzzleHttp\Ring\Exception\ConnectException' with message 'cURL error 7: Failed to connect to rets-rald.realtyserver.com port 6103: Connection timed out' in /public_html/phrets/vendor/guzzlehttp/ringphp/src/Client/CurlFactory.php:126
Stack trace:
#0 /public_html/phrets/vendor/guzzlehttp/ringphp/src/Client/CurlFactory.php(91): GuzzleHttp\Ring\Client\CurlFactory::createErrorResponse(Array, Array, Array)
#1 /public_html/phrets/vendor/guzzlehttp/ringphp/src/Client/CurlHandler.php(96): GuzzleHttp\Ring\Client\CurlFactory::createResponse(Array, Array, Array, Array, Resource id #69)
#2 /public_html/phrets/vendor/guzzlehttp/ringphp/src/Client/CurlHandler.php(68): GuzzleHttp\Ring\Client\CurlHandler->_invokeAsArray(Array)
#3 /public_html/phrets/vendor/guzzlehttp/ringphp/src/Client/Middleware.php(54): GuzzleHttp\Ring\Client\CurlHandler->__invoke(Array)
#4 /public_html/phrets/vendor/guzzlehttp/ringphp/src/Client/Middlewa in /public_html/phrets/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php on line 49
如何让它在网络服务器上运行?下面是我的配置。
$config = new \PHRETS\Configuration;
$config->setLoginUrl('http://rets-rald.realtyserver.com:6103/saskatchewan/rets/login');
$config->setUsername('username');
$config->setPassword('password');
$config->setRetsVersion('1.5');
$config->setUserAgent('PHRETS/2.0');
$config->setHttpAuthenticationMethod('digest');
$config->setOption('use_post_method', false);
$config->setOption('disable_follow_location', false);
【问题讨论】:
-
PHRETS 似乎在使用 Guzzle HTTP 客户端,而后者又使用 cURL。 cURL 使用
default_socket_timeout配置参数 (stackoverflow.com/questions/10308915/…),尝试在本地和远程机器上比较该参数。 -
他们都是 60 岁。还有其他建议吗?来自终端的数据立即返回。看起来很奇怪,它首先会超时。