Andrew Riker Andrew Riker - 10 days ago 7
PHP Question

PHP - Installing Composer - failed to open stream: php_network_getaddresses: getaddrinfo failed: No such host is known

I am attempting to use the Composer Dependency Manager for PHP, but I am experiencing the following issue when I use the Composer-Setup.exe (Win32 installer).

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.`


I followed the advice on several other stackoverflow threads for that error, and I've checked some other forums. In my php.ini, I have made sure I have the following options:

allow_url_fopen = On
allow_url_include = On
extension=php_openssl.dll


I also tried the manual installation of Composer, which asks you to execute:

php -r "eval('?>'.file_get_contents('https://getcomposer.org/installer'));"


I get the same error from that. However, If I remove "/installer", it can retrieve the source. I have verified that that the "/installer" URL works. What configuration could cause this behavior? I'm running PHP 5.4 on 32-bit Windows 7.

Thanks,
Andrew

Answer

This issue was actually the proxy variables. While the console was picking up the changes, PHP required a system restart to pick it up. So unsetting the environment variables and restarting allowed the Composer installer to retrieve the required files. Thanks Seldaek for your recommendation to check the proxy.

Comments