phpStudy集成环境下 安装composer失败

来源:互联网 发布:蔡珍妮的淘宝店 编辑:程序博客网 时间:2024/04/28 03:50

报错提示:


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 timeoutFailed to enable cryptofailed to open stream: operation failed

1、安装composer需要开启openssl拓展 而phpstudy默认是关闭的

2、将php/ext文件夹下的: php_openssl.dll, ssleay32.dll, libeay32.dll 3个文件拷贝到WINDOWS\system32 文件夹下。

3、openssl需要CA证书 phpstudy也是没有的

 CA证书下载地址:http://curl.haxx.se/docs/caextract.html

 选中之后单击右键选择另存为

 下载成功之后放到tmp文件夹下面

4、然后修改php.ini文件


openssl.cafile = "D:\phpStudy\tmp\cacert.pem"

5、重启phpStudy就可以了



报错提示:

failed to open stream: HTTP request failed!

1、检查一下php的curl拓展是否开启

2、检查这两个配置是否开启。

allow_url_fopen = Onuser_agent="PHP"

也可以这样配置 user_agent="Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)")

模拟浏览器访问也是一个不错的选择

3、开启之后重启重启phpStudy就可以了

0 0