Home  >  Article  >  Backend Development  >  PHP出现报错

PHP出现报错

WBOY
WBOYOriginal
2016-06-06 20:33:231277browse

Warning: stream_socket_client(): php_network_getaddresses: getaddrinfo failed: No such host is known. in D:\www\agcrm\vendor\mlehner\gelf-php\src\Gelf\MessagePublisher.php on line 144


这是144行代码
PHP出现报错
我不知道那里是那里的问题,我的配置是没问题的。

回复内容:

Warning: stream_socket_client(): php_network_getaddresses: getaddrinfo failed: No such host is known. in D:\www\agcrm\vendor\mlehner\gelf-php\src\Gelf\MessagePublisher.php on line 144


这是144行代码
PHP出现报错
我不知道那里是那里的问题,我的配置是没问题的。

从日志文件中已经找到错误了,原因是,存放另一个日志文件地址有问题。
所以说,日志文件很重要。

都提示在144行的代码有问题了。

gethostbyname()的参数$this->hostname有问题,如果是本地,直接写'localhost'或'127.0.0.1',如果是远程写远程的域或ip地址。

如果hostname是域名的话,要确认你主机是否支持。
可以先测试用IP直接访问是否可以。

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn