composer安装laravel总结

在尝试使用Composer安装Laravel时遇到了几个错误。错误1是由于未使用国内镜像,解决方案是设置Composer全局镜像为中国镜像源。错误2是缺少openssl扩展,需要开启PHP的openssl扩展或关闭Composer的TLS。错误3是配置不允许HTTP连接,可以禁用Composer的secure-http选项。完成这些步骤后,可能需要解决网络问题,通过运行`composer global require "laravel/installer"`来最终安装Laravel。
摘要由CSDN通过智能技术生成

错误1.
[RuntimeException]   Failed to clone https://github.com/symfony/process.git, git was not found, check that it is installed and in your P   ATH env.    'git' is not recognized as an internal or external command,   operable program or batch file.

问题原因: 未使用国内镜像
解决方案: 查看官网--https://pkg.phpcomposer.com
    composer config -g repo.packagist composer https://packagist.phpcomposer.com

错误2.
[Composer\Exception\NoSslException] 
The openssl extension is required for SSL/TLS protection but is not available. If you can not enable the openssl extension, you can disable this error, at your own risk, by setting the ‘disable-tls’ option to true.

问题描述: 不能使用ssl/tls(https)
解决方案:
    1.开启PHP openssl扩展,使用 php -m查看是否安装了openssl扩展
        windows下,修改php.ini--  ;extension=php_openssl.dll 前面的分号去掉
        linux下安装openssl扩展即可
    2.关掉composer的tls
        composer config -g -- disable-tls true

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值