数码资讯
安装composer失败
选购提示
关注价格、性能、续航、售后和真实使用场景,理性比较后再下单。
报错提示:
- The "https://getcomposer.org/versions" file could not be downloaded: failed to open stream: 由于连接方在一段时间后没有正确答复或连接的主机没有反应,连接尝试失败。
- The "https://getcomposer.org/download/1.2.0/composer.phar.sig" file could not be downloaded: SSL: crypto enabling timeout
- Failed to enable crypto
- failed to open stream: operation failed
1、安装composer需要开启openssl拓展 而phpstudy默认是关闭的
2、将PHP/ext文件夹下的: php_openssl.dll, ssleay32.dll, libeay32.dll 3个文件拷贝到WINDOWSsystem32 文件夹下。
3、openssl需要CA证书 phpstudy也是没有的
CA证书下载地址:https://curl.haxx.se/docs/caextract.html
选中之后单击右键选择另存为
下载成功之后放到tmp文件夹下面
4、然后修改php.ini文件
[cpp] view plain copy print ?
- openssl.cafile = "D:phpStudy mpcacert.pem"
5、重启phpStudy就可以了
报错提示:
[cpp] view plain copy print ?
- failed to open stream: HTTP request failed!
1、检查一下php的curl拓展是否开启
2、检查这两个配置是否开启。
[cpp] view plain copy print ?
- allow_url_fopen = On
- user_agent="PHP"
也可以这样配置 user_agent="Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)")
模拟浏览器访问也是一个不错的选择
3、开启之后重启重启phpStudy就可以了
声明:本文内容用于数码产品信息整理与选购参考,具体价格、库存、售后政策以官方渠道和电商页面实时信息为准。