douchuanchai2793 2017-02-20 19:20
浏览 167
已采纳

获取未定义索引: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:

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

  • 写回答

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.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 Python时间序列如何拟合疏系数模型
  • ¥15 求学软件的前人们指明方向🥺
  • ¥50 如何增强飞上天的树莓派的热点信号强度,以使得笔记本可以在地面实现远程桌面连接
  • ¥20 双层网络上信息-疾病传播
  • ¥50 paddlepaddle pinn
  • ¥20 idea运行测试代码报错问题
  • ¥15 网络监控:网络故障告警通知
  • ¥15 django项目运行报编码错误
  • ¥15 STM32驱动继电器
  • ¥15 Windows server update services