【问题标题】:`lando artisan` command returns a weird error`lando artisan` 命令返回一个奇怪的错误
【发布时间】:2021-04-10 23:27:57
【问题描述】:

如果你一起使用过 Laravel 和 Lando,你可能知道 Lando 为你提供了自己的 artisan 快​​捷方式。所以不必运行lando php artisan ...,您可以运行lando artisan ...

但是,当我这样做时,我得到了这个错误:

Could not open input file: /app/./../artisan

这迫使我必须运行 lando php artisan 才能运行任何工匠命令,而且效果很好。到目前为止,这就是我在兰多的项目的所有问题。其他一切都运行顺利。

这是我的lando 配置的样子:

name: laravel-project
recipe: laravel
config:
  php: '7.4'
  composer_version: '2.0.12'
  database: mysql:8.0
services:
  appserver:
    webroot: public
    xdebug: true
    config:
      php: .vscode/php.ini
  node:
    type: node:14
tooling:
  node:
    service: node
  yarn:
    service: node

此外,这确实与 Lando 在其网站上的 sample config 有点不同。这是因为我试图根据他们的"Using Lando with VSCode" 说明配置 xdebug(请参阅 Lando rc.2+ 版本)。

感谢任何帮助解决这个奇怪的问题。它不会使人衰弱,但当我忘记解决方法时,它确实会妨碍我。


其他说明:

  • “webroot”设置为“public”,因为这是 Laravel 应用程序的面向公众的目录所在的位置。示例Lando config for Laravel 有这部分错误,导致项目根目录对浏览器可见。

【问题讨论】:

    标签: php laravel lando


    【解决方案1】:

    我让它工作了。我将webroot 键移回顶级config 下。不知道有什么区别,但只要它有效……我想我真正需要在appserver 服务中指定的唯一内容就是 Xdebug 设置。

    name: laravel-project
    recipe: laravel
    config:
      php: '7.4'
      composer_version: '2.0.12'
      webroot: public
      database: mysql:8.0
    services:
      appserver:
        xdebug: true
        config:
          php: .vscode/php.ini
      node:
        type: node:14
    tooling:
      node:
        service: node
      yarn:
        service: node
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-02-18
      • 2011-04-30
      • 1970-01-01
      • 1970-01-01
      • 2018-11-14
      • 2015-10-25
      • 2017-01-18
      相关资源
      最近更新 更多