Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/google-maps/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
不了解从Symfony 4.4升级到5.0时出现的奇怪错误_Symfony_Symfony5 - Fatal编程技术网

不了解从Symfony 4.4升级到5.0时出现的奇怪错误

不了解从Symfony 4.4升级到5.0时出现的奇怪错误,symfony,symfony5,Symfony,Symfony5,我一直在尝试将我们的网站从Symfony 4.4升级到5.0。我最终解决了所有composer依赖项,现在我发现以下错误: The file "../src/Controller/" does not exist (in: "/home/avrsites/websites/xxxx.com/symfony/config/routes") in ../src/Controller/ (which i s being imported from "/home/avrsites/websit

我一直在尝试将我们的网站从Symfony 4.4升级到5.0。我最终解决了所有composer依赖项,现在我发现以下错误:


  The file "../src/Controller/" does not exist (in: "/home/avrsites/websites/xxxx.com/symfony/config/routes") in ../src/Controller/ (which i
  s being imported from "/home/avrsites/websites/xxxx.com/symfony/config/routes/routes.yaml"). Make sure annotations are installed and enabl
  ed.


In FileLocator.php line 71:

  The file "../src/Controller/" does not exist (in: "/home/avrsites/websites/xxxx.com/symfony/config/routes").

我的路由配置中没有任何更改,在4.4上一切都正常运行。这是一个相当复杂的设置,它有两台主机运行在同一个Symfony项目上(其中一台使用API平台并运行在单独的子域上)


注释已启用,因此我感觉此错误消息具有误导性,实际问题是其他问题。

我终于找到了答案

在我的
config/routes/routes.yaml
文件中,我必须进行以下更改:

resource: '../src/Controller/'

我的
config/routes/dev/routes.yaml
文件中也有类似的更改:

resource: '../../src/Controller/`

这修复了上面的错误,但我仍然遇到了一些其他问题,并且对
config/routes/dev/twig.yaml
进行了这些更改:

resource: '@TwigBundle/Resources/config/routing/errors.xml'

为了修复其他错误,我还从一个全新的symfony5项目复制了
public/index.php
config/bootstrap.php
文件


现在我的项目已经编译完毕,我正在测试以确保一切正常。

考虑搜索类似“文件”。/src/Controller/“不存在”。我在各种问题中看到过这种信息,通常有不同的解决方案。并确保您使用的是最新的PHP7.4.4。一些早期的php版本存在预加载问题,这会生成神秘的错误消息。该消息在Symfony
http foundation/File/Exception/FileNotFoundException.php
文件中生成。到目前为止,这不是很有帮助,因为在许多位置使用了
FileNotFoundException
。我试图更深入地了解它。在这种情况下,我所说的搜索是指互联网搜索。我之前尝试过,但没有发现任何有用的东西。现在我已经创建了一个新的Symfony 5安装,并且正在将该项目上的virgin配置文件与我当前的项目进行比较。很高兴你让它工作起来。每当我升级一个主要版本时,我总是从头开始创建一个新的项目,安装我所有的第三方包,并将其作为一个起点。事情仍然没有100%正常工作,但我正在接近。现在,我正在查看日志文件中的错误,并进行代码修复(到目前为止,大多数是小错误)。
resource: '../../../src/Controller/`
resource: '@TwigBundle/Resources/config/routing/errors.xml'
resource: '@FrameworkBundle/Resources/config/routing/errors.xml