Why composer does not installing laravel 5.6 propoerly?

孤人 提交于 2019-12-10 17:07:42

问题


I am unable to install Laravel 5.6 on my wamp server. I have following setup

  • PHP Version 7.1.3
  • Composer Version 1.6.3 2018-01-31

When I am trying to install laravel application through composer, I am receiving following error in 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 returning these errors multiple times and at the end the error following message receiving

Application ready! Build something amazing.

When I am trying to run this command php artisan serve then cmd return following error

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

I have searched about it and found a couple of articles but all of them are saying this is about PHP version and some are saying I need to update the composer and some says I need to stop proxy or any anti-virus software.

I have done all above steps as instructed in different articles but still facing the same problem. I am still failed to install laravel 5.6.

I would like to appreciate if someone guides me that how can I fix the issue.

Edited

After following the instruction of @laravel levaral answer, I am facing below following errors.

[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>]

The above errors are also in the cmd


回答1:


Laravel 5.6 require PHP >= 7.1.3

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

You don't need 'php artisan serve' if you are running in wamp/xamp. Just make virtual host and point your vhost directory to your installation folder blog/public.




回答2:


It is not installing because it exists in cache of your system.

Run the following commands.

composer clearcache

Also specify the version while creating the project.

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

make sure you have installed open-ssl extension in your php or run this command

composer config -g -- disable-tls true

for Installing extension in windows, u can simply uncomment this line

extension=php_openssl.dll

restart your server and you are good to go.

Hope this helps



来源:https://stackoverflow.com/questions/49146472/why-composer-does-not-installing-laravel-5-6-propoerly

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!