5

我无法Laravel 5.6在我的 wamp 服务器上安装。我有以下设置

  • PHP 版本 7.1.3
  • Composer 版本 1.6.3 2018-01-31

当我尝试通过 composer 安装 laravel 应用程序时,我收到以下错误cmd

警告:count():参数必须是在 C:\Users\MyName\AppData\Roaming\Composer\vendor\symfony\process\Pipes\Windo wsPipes.php 中实现 Counta ble 的数组或对象(第 221 行)

cmd多次返回这些错误,最后在收到消息后返回错误

申请准备好了!建立一些惊人的东西。

当我尝试运行此命令时php artisan servecmd返回以下错误

警告:require(D:\wamp64\www\Laravel5.6\PR/vendor/autoload.php): 无法打开流:D:\wamp64\www\Laravel5.6\PR\artisan 中没有这样的文件或目录在线 18

致命错误:require():在 D:\wamp64 中打开所需的 'D:\wamp64\www\Laravel5.6\PR/ven dor/autoload.php' (include_path='.;C:\php\pear') 失败\www\Laravel5.6\PR\ artisan 在第 18 行

我已经搜索过它并找到了几篇文章,但他们都说这是关于 PHP 版本的,有些人说我需要更新作曲家,有些人说我需要停止代理或任何防病毒软件。

我已经按照不同文章中的说明完成了上述所有步骤,但仍然面临同样的问题。我仍然无法安装laravel 5.6

如果有人指导我如何解决该问题,我将不胜感激。

已编辑

遵循@laravel levaral answer的指示后,我面临以下错误。

[Composer\Exception\NoSslException]
  The openssl extension is required for SSL/TLS protection but is not availab
  le. 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.


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

以上错误也在cmd

4

2 回答 2

4

Laravel 5.6 需要 PHP >= 7.1.3

https://laravel.com/docs/5.6#installing-laravel

如果您在 wamp/xamp 中运行,则不需要“php artisan serve”。只需制作虚拟主机并将您的虚拟主机目录指向您的安装文件夹 blog/public。

于 2018-03-07T07:42:26.647 回答
1

它没有安装,因为它存在于系统的缓存中。

运行以下命令。

composer clearcache

在创建项目时还要指定版本。

composer create-project --prefer-dist laravel/laravel blog "5.6.*"

确保你已经在你的 php 中安装了 open-ssl 扩展或者运行这个命令

composer config -g -- disable-tls true

对于在 windows 中安装扩展,你可以简单地取消注释这一行

extension=php_openssl.dll

重新启动您的服务器,您就可以开始了。

希望这可以帮助

于 2018-03-07T09:34:06.893 回答