【问题标题】:symfony 4 application not updated in homestead/vagrantsymfony 4 应用程序未在 homestead/vagrant 中更新
【发布时间】:2018-01-22 12:38:35
【问题描述】:

我将 Homestead 用于 symfony 4 应用程序。 Everthings 与 symfony 网络服务器一起工作,但是, homestead 无法识别控制器更改。

例如: 我在 TestController 中创建 /test 路线,但在宅基地

No route found for "GET /test"

我运行cache:clear 并删除var 目录但没有任何改变。 我正在使用 arch linux 和 homestead/virtualbox。

谁能帮我解决这个问题?

谢谢,

【问题讨论】:

  • 你使用宅基地的开发环境吗?
  • sf 是 .env 中的开发者,我在 vagrant [WARNING] Failed to remove directory "/home/vagrant/code/sf18/var/cache/de~/ContainerJfG7x9X": .[OK] Cache for the dev environment (debug=true) was successfully cleared. 中有警告 cache:clear

标签: php symfony virtualbox homestead


【解决方案1】:

我使用自定义 vagrant 脚本来构建我的虚拟机,但我遇到过几次这个问题 - 这就是我解决它的方法:

src/Kernel.php

public function getCacheDir ()
{
    //return $this->getProjectDir().'/var/cache/'.$this->environment;
    return '/var/tmp/cache/' . $this->environment;
}

public function getLogDir ()
{
    //return $this->getProjectDir() . '/var/log';
    return '/var/tmp/log';
}

另请阅读https://symfony.com/doc/current/configuration/override_dir_structure.html#override-cache-dir

【讨论】:

    【解决方案2】:

    我解决了我的问题。
    我重新创建了宅基地框,并且在 homestead.yaml 文件中只留下了一个站点。 sites: - map: sf18.app to: /home/vagrant/code/sf18/public type: symfony4

    我相信它与 homestead.yaml 和 homestead-17 框有关。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-11-19
      • 1970-01-01
      • 2018-12-23
      • 2018-01-03
      • 1970-01-01
      • 2020-04-18
      • 1970-01-01
      相关资源
      最近更新 更多