2017-02-20 19:20
浏览 132

获取未定义索引:REQUEST_URI - 在Laravel中运行Artisan命令时

I keep getting the error below every time I try to run an artisan command on Laravel, I'm on the project directory.

For example, I run this command:

php artisan make:migration create_stats_table

And I get this error:

  Undefined index: REQUEST_URI

No matter what command I run, I get the same error, even php artisan --version returns this error. How can I solve this problem?

图片转代码服务由CSDN问答提供 功能建议

我每次尝试在Laravel上运行artisan命令时都会出现以下错误,我在项目中 例如,我运行此命令:

  php artisan make:migration create_stats_table 


 \  n 

无论我运行什么命令,我都会得到同样的错误,即使 php artisan --version 也会返回此错误。 我该如何解决这个问题呢?

  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • doog1092 2017-02-20 19:24

    Your code expects to have this index, but you're running PHP in CLI mode. REQUEST_URI variable of $_SERVER superglobal is only available if you're reaching script by browser.

    打赏 评论

相关推荐 更多相似问题