问题
So I am trying to install Composer and setup Laravel on my Windows OS how ever I keep getting the same error when I run the install.
To start I selected php.exe as it asks from directory C:\wamp\bin\php\php5.4.16
I click next, then install and it will go through like its install then stop and display the error:
An error occurred. Clicking Retry may resolve this issue.
Connection error [ERR_CONNECTION]:Unable to connect to getcomposer.org
Request to http://getcomposer.org/installer failed with errors:
Failed to open stream: A connection attempt failed because the connected party
did not properly respond after a period of time, or established connection failed
because connection host has failed to respond.
Now I'm not sure if I have to sets something up or change something in the php.ini file to make this take place but from what I can tell the site getcomposer.org is unable to communicate with my PC as if I have a firewall up blocking it which my firewall is turned off at the time of installation.
I was unable to find a matching question on stack overflow or in any online search, so I went ahead and thought I'd ask to see if anyone can help out, thank you.
回答1:
The PHP CLI ( Command Line Interface i.e running php from the command line ) uses a different php.ini to the one used by PHP under apache.
Edit the php.ini file that is on your C:\wamp\bin\php\php5.4.16
and make sure you have the extension php_openssl
and 'php_curl` enabled.
回答2:
You can try in a console if pinging the composer.org website works,
like so... ping composer.org
, if that does not work that explains why the install fails.
来源:https://stackoverflow.com/questions/22545257/composer-install-for-windows