laravel:php artisan 不工作

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/35414838/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 13:14:22  来源:igfitidea点击:

laravel : php artisan not working

phplaravelcommand-lineartisanartisan-migrate

提问by cjmling

I know there is bunch of answer out there and none of them solved my problem. I am giving a try again in 2016 may be some one can help.

我知道那里有很多答案,但没有一个能解决我的问题。我在 2016 年再试一次,可能有人可以提供帮助。

php artisan make:migration createxxxtable

don't show any error and it don't create the file

不显示任何错误,也不创建文件

neither of these function output anything too.

这些函数都不输出任何东西。

php artisan list
php artisan help migrate

Its not new project. I had been working on this project earlier and it was working fine. Created bunch of migration.

它不是新项目。我之前一直在研究这个项目,它运行良好。创建了一堆迁移。

I tried deleting everying inside vendor and do composer installand composer updatestill no luck.

我试着删除万万内的供应商,做composer installcomposer update仍然没有运气。

I did tried command like dump-autoload , optimize , clear-compiled etc. too

我也尝试过像 dump-autoload 、 optimize 、 clear-compiled 等命令

Thanks

谢谢

回答by cjmling

Ok found the solution. I don't know whats the reason. But it was because I was using url()helper in a custom config filei created in config folder. The config file and value of url and others works fine all across the website but it just break artisan command. I don't know why.

好的找到了解决方案。我不知道是什么原因。但这是因为我在 config 文件夹中创建url()自定义配置文件中使用了helper 。url 和其他人的配置文件和值在整个网站上都可以正常工作,但它只是破坏了 artisan 命令。我不知道为什么。

Removing that url()helper from my custom config file solved the problem.

url()从我的自定义配置文件中删除该帮助程序解决了这个问题。

回答by acquayefrank

Normally when this issue arises it's due to an error in your code. Check for these coporates

通常,出现此问题的原因是您的代码中存在错误。检查这些公司

  1. Could be a typo in your .env file
  2. Could be a syntax error in your .env
  3. Entering in wrong configuration(syntax error) in your config folder
  1. 可能是您的 .env 文件中的错字
  2. 可能是您的 .env 中的语法错误
  3. 在您的 config 文件夹中输入错误的配置(语法错误)

回答by Akash Shah

can you please try php artisan does that open up the artisan commands? If these doesn't show anything then check your path to project in console.

你能试试 php artisan 是否打开了 artisan 命令?如果这些没有显示任何内容,请检查您在控制台中的项目路径。