因此,我正在尝试在我的 Windows 操作系统上安装 Composer 和设置 Laravel,但是我在运行安装时总是遇到同样的错误。
首先,我从目录 C:\wamp\bin\php\php5.4.16
中选择了 php.exe
我点击下一步,然后安装,它会像安装一样进行,然后停止并显示错误:
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.
现在我不确定是否必须在 php.ini 文件中设置或更改某些内容才能实现此目的,但据我所知,站点 getcomposer.org 无法与我的 PC 通信,就好像我有一个防火墙阻止它,我的防火墙在安装时是关闭的。
我无法在 stack overflow 或任何在线搜索中找到匹配的问题,所以我继续前进并想问问是否有人可以提供帮助,谢谢。
最佳答案
PHP CLI(命令行界面,即从命令行运行 php)使用与 PHP 在 apache 下使用的不同的 php.ini。
编辑 C:\wamp\bin\php\php5.4.16
上的 php.ini 文件,确保你有扩展名 php_openssl
和 'php_curl ` 启用。
关于php - 适用于 Windows 的 Composer 安装-,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22545257/