站长资讯网
最全最丰富的资讯网站

Composer安装及解决遇到的问题

下面由composer教程栏目带大家介绍Composer安装及解决遇到的问题 ,希望对需要的朋友有所帮助!

Composer安装及解决遇到的问题

类库查找网站 :https://packagist.org/

Composer中文网:https://www.phpcomposer.com/

安装Composer

在这之前,先检查你的php版本和相关扩展

1.php>=5.6
2.OpenSSL扩展是否配置完成
3.Composer安装包以及OpenSSL所需要的证书下载地址
4.下载完成后,打开安装程序,跟着步骤走就行。
5.中间选择路径要选择你要使用的php版本的php.exe文件
6.如果安装遇到问题下载失败,多试几遍即可。

如果你的OpenSSL扩展没有配置的话,就可能会产生以下错误:

Some settings on your machine make Composer unable to work properly.  Make sure that you fix the issues listed below and run this script again: The openssl extension is missing, which means that secure HTTPS transfers are impossible.  If possible you should enable it or recompile php with –with-openssl

解决方法:

1.在php的安装目录比如说D:wampbinphpphp5.6中,找到找个目录下的php.ini文件,然后去掉 extension=php_openssl.dll 这一行开头的注释。注意:因为SSL连接需要认证,所以继续下面的步骤之前,需要准备好CA证书(建议证书保存到php的相关目录中),可以从https://curl.haxx.se/docs/caextract.html处下载。也可以从上面步骤3中下载。
2。修改php.ini文件中的openssl.cafile。在php文件夹中创建一个ssl文件夹,里面放入证书后,修改php.ini文件,openssl.cafile=”D:phpStudyphpsslcacert.pem”,最后重启下php环境,应该就能安装上了。

赞(0)
分享到: 更多 (0)