Laravel 5.3安装错误

时间:2017-01-24 04:23:25

标签: laravel composer-php laravel-5.3

我刚刚安装了PHP版本7的xampp并安装了编辑器。当我在作曲家composer create-project --prefer-dist laravel/laravel blog中输入此内容时,会出现以下错误。我该如何解决呢?

E:\xampp\htdocs>composer create-project --prefer-dist laravel/laravel blog
You are running Composer with SSL/TLS protection disabled.


  [Composer\Downloader\TransportException]
  The "http://packagist.org/p/provider-2016-04%245bb94436a929d80601958ea5367e
  6b3d5111776068c6d8355f4234987de86504.json" file could not be downloaded (HT
  TP/1.1 302 Found)


create-project [-s|--stability STABILITY] [--prefer-source] [--prefer-dist] [--repository REPOSITORY] [--repository-url REPOSITORY-URL] [--dev] [--no-dev] [--no-custom-installers] [--no-scripts] [--no-progress] [--no-secure-http] [--keep-vcs] [--no-install] [--ignore-platform-reqs] [--] [<package>] [<directory>] [<version>]

1 个答案:

答案 0 :(得分:1)

它不安全,不推荐用于您的服务器,但对于本地PC,您可以运行该命令。

运行命令:

composer config -g -- disable-tls true

然后重新运行composer它将起作用

如果您不想在您的计算机/服务器中启用不安全的图层,请设置您的php以启用openssl,它也可以。确保已安装PHP Openssl扩展并在php.ini文件上启用它。