创建Laravel项目会返回错误"找不到系统CA包"

时间:2017-04-05 08:41:02

标签: laravel

我安装了Laravel。现在我想用命令(laravel new foldername)创建项目,但我得到这样的错误:

[GuzzleHttp\Exception\RequestException]

  No system CA bundle could be found in any of the the common system locations.
  PHP versions earlier than 5.6 are not properly configured to use the system's
  CA bundle by default. In order to verify peer certificates, you will need to
  supply the path on disk to a certificate bundle to the 'verify' request
  option: http://docs.guzzlephp.org/en/latest/clients.html#verify. If you do not
  need a specific certificate bundle, then Mozilla provides a commonly used CA
  bundle which can be downloaded here (provided by the maintainer of cURL):
  https://raw.githubusercontent.com/bagder/ca-bundle/master/ca-bundle.crt. Once
  you have a CA bundle available on disk, you can set the 'openssl.cafile' PHP
  ini setting to point to the path to the file, allowing you to omit the 'verify'
  request option. 

3 个答案:

答案 0 :(得分:1)

我会升级您的PHP版本。

https://laravel.com/docs/5.4/installation

PHP> = 5.6.4

答案 1 :(得分:-1)

我认为这是一个Guzzle问题而不是一个纯粹的问题。无论如何试试这个。

1-下载此文件https://curl.haxx.se/ca/cacert.pem并将其保存在计算机的某个位置。例如,c:/xampp/cacert.pem

2-打开php.ini配置文件

3-查找以下配置,如果存在则取消注释,如果不存在则添加注释:

[curl]
curl.cainfo=c:/xampp/cacert.pem

答案 2 :(得分:-1)

Laravel有详细记录,我建议您先阅读文档,了解安装过程。几乎没有基本要求需要实现:

  • PHP> = 5.6.4
  • OpenSSL PHP扩展
  • PDO PHP Extension
  • Mbstring PHP扩展
  • Tokenizer PHP扩展
  • XML PHP扩展

https://laravel.com/docs/5.4

您的问题被否决,因为您没有清楚地解释您的问题。根据我的理解,你想按命令创建项目,如composer create-project {项目名称}

laravel与命令创建项目无关。 Composer正在为我们完成所有这些工作。首先安装composer然后尝试使用composer create-project命令创建项目。