composer安装laravel总结

错误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


错误3.
[Composer\Downloader\TransportException]
  Your configuration does not allow connections to http://packagist.org/packages.json. See https://getcomposer.org/doc/06-config.md#secure-http for details.

问题描述:自己的配置文件不支持http
解决方案:禁用ssl
    composer config -g secure-http false

 

更改镜像地址后,继续出现错误1,有可能是网络原因,继续执行

       composer global require "laravel/installer"

成功

composer安装laravel总结_第1张图片

你可能感兴趣的:(composer)