file_get_contents(http:// localhost:51089):没有这样的主机

时间:2013-06-30 04:42:30

标签: php google-app-engine

我正在按照谷歌应用引擎"Using the User Service"的分步指南,但我在本地运行应用服务器之后

C:\Users\xxx>dev_appserver.py --php_exectuable_path="C:\Users\xxx\Desktop\php54\php-cgi.exe" C:\Users\xxx\Desktop\FirstPhpPrj\
弹出

以下错误:

Warning:  file_get_contents(): php_network_getaddresses: getaddrinfo failed:
 No such host is known.  in <b>C:\Users\xxx\Desktop\google_appengine\php\sdk\
google\appengine\runtime\RemoteApiProxy.php</b> on line 92

Warning:

    file_get_contents(http://localhost:51089)

: failed to open stream:
 php_network_getaddresses: getaddrinfo failed: No such host is known.  in C
:\Users\xxx\Desktop\google_appengine\php\sdk\google\appengine\runtime\RemoteApiP
roxy.php on line 92

Fatal error:  Uncaught exception 'google\net\ProtocolBufferDecodeError' 
with message 'Not initialized: login_url' in C:\Users\xxx\Desktop\google_appengin
e\php\sdk\google\appengine\runtime\proto\ProtocolMessage.php:121

Stack trace:

    #0 C:\Users\xxx\Desktop\google_appengine\php\sdk\google\appengine\runtime\proto\
    ProtocolMessage.php(88): google\net\ProtocolMessage-&gt;mergeFromString('')


    #1 C:\Users\xxx\Desktop\google_appengine\php\sdk\google\appengine\runtime\Remote
    ApiProxy.php(109): google\net\ProtocolMessage-&gt;parseFromString('')


    #2 C:\Users\xxx\Desktop\google_appengine\php\sdk\google\appengine\runtime\ApiProxy.php(42): google\appengine\runtime\RemoteApiProxy-&gt;makeSyncCall('user', 'CreateLoginURL', Object(google\appengine\CreateLoginURLRequest), Object(google\app
    engine\CreateLoginURLResponse), NULL)


    #3 C:\Users\xxx\Desktop\google_appengine\php\sdk\google\appengine\api
    \users\UserService.php(69): google\appengine\runtime\ApiProxy::makeSyncCall('user', 'CreateLoginURL', Object(google\appengine\CreateLoginURLRequest), Object(google in C
    :\Users\xxx\Desktop\google_appengine\php\sdk\google\appengine\runtime\proto\ProtocolMessage.php on line 121

我浏览了日志,有两个警告和一个致命错误。但是在我通过php sdk的编码看后,我意识到由“mergeFromString”中的空字符串输入引起的这个致命错误实际上是由“

的警告引起的
file_get_contents(http://localhost:51089)

没有这样的主机“,因为在RemoteApiProxy.php中,函数CreateLoginURLResponse:

$serialized_remote_respone = file_get_contents(
'http://localhost:' . $this->apiPort, false, $context);

一旦serialized_remote_response获得一个空结果,它将影响下一行中的命令:

$remote_response->parseFromString($serialized_remote_respone);

在这种情况下,我自己的代码实际上是不相关的,因为它与Google示例代码完全相同:here

我只是想在谷歌应用引擎启动其API服务器

之后找出原因
http://localhost:51089

但它不被认可!我试过固定这个主机,Windows也扔错了!

0 个答案:

没有答案