我无法在我的 wamp 服务器上安装 Laravel 5.6
。我有以下设置
- PHP 版本 7.1.3
- Composer 版本 1.6.3 2018-01-31
当我尝试通过 composer 安装 laravel 应用程序时,我在 cmd
中收到以下错误
Warning: count(): Parameter must be an array or an object that implements Counta ble in C:\Users\MyName\AppData\Roaming\Composer\vendor\symfony\process\Pipes\Windo wsPipes.php on line 221
cmd
多次返回这些错误,最后在收到消息后出现错误
Application ready! Build something amazing.
当我尝试运行此命令时 php artisan serve
然后 cmd
返回以下错误
Warning: require(D:\wamp64\www\Laravel5.6\PR/vendor/autoload.php): failed to ope n stream: No such file or directory in D:\wamp64\www\Laravel5.6\PR\artisan on li ne 18
Fatal error: require(): Failed opening required 'D:\wamp64\www\Laravel5.6\PR/ven dor/autoload.php' (include_path='.;C:\php\pear') in D:\wamp64\www\Laravel5.6\PR\ artisan on line 18
我搜索了它并找到了几篇文章,但所有文章都说这是关于 PHP 版本的,有些人说我需要更新 Composer ,有些人说我需要停止代理或任何防病毒软件。
我已经按照不同文章中的说明完成了上述所有步骤,但仍然面临同样的问题。我仍然无法安装 laravel 5.6
。
如果有人指导我如何解决这个问题,我将不胜感激。
已编辑
按照 @laravel levaral的说明进行操作后 回答,我面临以下错误。
[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
中也有上述错误
最佳答案
Laravel 5.6 需要 PHP >= 7.1.3
https://laravel.com/docs/5.6#installing-laravel
如果您在 wamp/xamp 中运行,则不需要“php artisan serve”。只需制作虚拟主机并将您的虚拟主机目录指向您的安装文件夹 blog/public。
关于php - 为什么 composer 没有正确安装 laravel 5.6?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49146472/