[英]How add Artisan cli to existing laravel project?
I have issue with Artisan usage on Windows 10 with Xampp.我在 Xampp 的 Windows 10 上使用 Artisan 时遇到问题。
What have I done:我做了什么:
In directory with project i trying run:在我尝试运行的项目目录中:
php artisan
but i get errror:但我得到错误:
Could not open input file: artisan
无法打开输入文件:工匠
But if i run command但是如果我运行命令
php bin/console
i get list of command like cache, debug, eloquent... so some tools are there... But none artisan... php bin/console
我得到命令列表,如缓存、调试、eloquent ......所以有一些工具......但没有工匠......
How i can add/use artisan into existing project?我如何在现有项目中添加/使用工匠?
Check if artisan
file exists in your project root folder.检查项目根文件夹中是否存在
artisan
文件。 If it does, then you're probably on the wrong folder.如果是这样,那么您可能位于错误的文件夹中。 If it doesn't exist, you can just download it from the official repo .
如果它不存在,您可以从官方 repo 下载它。
To configure an existing project, you'd typically check those things first:要配置现有项目,您通常会首先检查这些内容:
You should goto app/config/database.php check file and verify username and password.您应该转到 app/config/database.php 检查文件并验证用户名和密码。
After check in Project Folder vendor folder and composer.json file exist then remove it (that remove old configuration now we going to fresh configuration).签入项目文件夹供应商文件夹和 composer.json 文件后,将其删除(即删除旧配置,现在我们将进行新配置)。
Then after back to command prompt and fire command composer update and that download some dependent file download.然后返回命令提示符并触发命令 composer update 并下载一些依赖文件下载。
Now Run php artisan serve现在运行 php 工匠服务
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.