我正在尝试使用PHP的Composer Dependency Manager,但在使用Composer-Setup.exe (Win32安装程序)时遇到以下问题。
Download failed: php_network_getaddresses: getaddrinfo failed: No such host is known.
failed to open stream: php_network_getaddresses: getaddrinfo failed: No such host is known.
Download failed: php_network_getaddresses: getaddrinfo failed: No such host is known.
failed to open stream: php_network_getaddresses: getaddrinfo failed: No such host is known.
Download failed: php_network_getaddresses: getaddrinfo failed: No such host is known.
failed to open stream: php_network_getaddresses: getaddrinfo failed: No such host is known.
The download failed repeatedly, aborting.`我遵循了其他几个stackoverflow线程的建议来解决这个错误,我还查看了一些其他论坛。在我的php.ini中,我已确保具有以下选项:
allow_url_fopen = On
allow_url_include = On
extension=php_openssl.dll我还尝试了Composer的manual installation,它要求您执行:
php -r "eval('?>'.file_get_contents('https://getcomposer.org/installer'));"我从那里得到了同样的错误。但是,如果我删除"/installer",它可以检索源代码。我已经验证了"/installer“网址是有效的。什么配置会导致此行为?我在32位Windows 7上运行PHP 5.4。
谢谢,安德鲁
发布于 2012-12-29 07:52:05
这个问题实际上是代理变量。在控制台获取更改时,PHP需要重新启动系统才能获取更改。因此,取消设置环境变量并重新启动允许Composer安装程序检索所需的文件。感谢Seldaek推荐您检查代理。
发布于 2015-12-12 17:52:43

解决方案1
尝试对www.google.com执行
解决方案2
- Remove Proxy settings ,they could be ones causing it,if outside a corporate network解决方案3
上,则添加公司代理设置
- set http\_proxy=[http://your\_proxy:your\_port](http://your_proxy:your_port)
- set http\_proxy=[http://username:password@your\_proxy:your\_port](http://username:password@your_proxy:your_port)
- set https\_proxy=[https://your\_proxy:your\_port](https://your_proxy:your_port)
- set https\_proxy=[https://username:password@your\_proxy:your\_port](https://username:password@your_proxy:your_port)
发布于 2013-10-31 23:14:40
mysqli_connect('root','', 'localhost', 'people');您正在将root作为主机名传入。
尝尝这个
mysqli_connect('localhost','root', '', 'people');这将使用用户名root passwoord "“和默认数据库people连接到localhost。
也许用127.0.0.1更改localhost会更好
https://stackoverflow.com/questions/14000646
复制相似问题