简体   繁体   English

使用 Composer 安装 Laravel 8 时出错

[英]Error while installing Laravel 8 using Composer

I am new to Laravel.我是 Laravel 的新手。 I installed Composer globally on the "C:" drive and installed XAMP too.我在“C:”驱动器上全局安装了 Composer 并安装了 XAMP。 But after that, when I try to install Laravel, it gives me the error on CL, and hence the setup breaks.但是在那之后,当我尝试安装 Laravel 时,它给了我 CL 上的错误,因此设置中断了。

[InvalidArgumentException] Composer could not find the config file: C:\\xampp\\phpMyAdmin To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ "Getting Started" section [InvalidArgumentException] Composer 找不到配置文件:C:\\xampp\\phpMyAdmin 要初始化项目,请按照https://getcomposer.org/ “入门”部分中的描述创建一个 composer.json 文件

I searched a lot for this but couldn't find any relevant thing to it.我为此搜索了很多,但找不到任何相关的东西。

install composer with this link: https://getcomposer.org/Composer-Setup.exe使用此链接安装作曲家: https : //getcomposer.org/Composer-Setup.exe

and open setup and use recommended settings并打开设置并使用推荐的设置

then unchecked the developer mode and next on prompt then select this path in your c drive if your xampp install in c drive.然后取消选中开发人员模式,然后在提示下选择此路径,如果您的 xampp 安装在 c 驱动器中。

    C:\xampp\php\php.exe

Then next may be you have the checkbox underneath so do check it, then in proxy page left it blank and then next and install then wait and next and finish.然后接下来可能是您有下面的复选框,所以请检查它,然后在代理页面将其留空,然后下一步并安装,然后等待,下一步并完成。

Then go to cmd and type in root user:然后转到cmd并输入root用户:

    composer

If you see this scree then composer is installed succesfully :如果您看到此屏幕,则 Composer 已成功安装:

 / ____/___  ____ ___  ____  ____  ________  _____
 / /   / __ \/ __ `__ \/ __ \/ __ \/ ___/ _ \/ ___/
/ /___/ /_/ / / / / / / /_/ / /_/ (__  )  __/ /
\____/\____/_/ /_/ /_/ .___/\____/____/\___/_/
                    /_/
Composer version 2.1.3 2021-06-09 16:31:20

Now go to htdocs in xampp then go to search bar and type cmd in it and cmd open in the selected folder of xampp.现在转到 xampp 中的 htdocs,然后转到搜索栏并在其中键入 cmd,然后在 xampp 的选定文件夹中打开 cmd。

Then type:然后输入:

composer create-project --prefer-dist laravel/laravel YOUR NAME

If you see this line:如果你看到这一行:

Application key set successfully.

Then Your project is created.然后你的项目就创建好了。

Enjoy Developing!!!享受开发!!!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM