Symfony 4 缓存:没有这样的文件或目录

2024-01-03

我尝试使用 symfony 4 创建一个新项目。项目文件夹是通过默认的 symfony 4 skelleton 项目创建的composer create-project symfony/website-skeleton test.

这是命令的输出:

composer create-project symfony/website-skeleton test
Installing symfony/website-skeleton (v3.4.4)
  - Installing symfony/website-skeleton (v3.4.4): Loading from cache
Created project in test
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 89 installs, 0 updates, 0 removals
  - Installing ocramius/package-versions (1.2.0): Loading from cache
  - Installing symfony/flex (v1.0.70): Loading from cache
  - Installing doctrine/lexer (v1.0.1): Loading from cache
  - Installing doctrine/inflector (v1.2.0): Loading from cache
  - Installing doctrine/collections (v1.4.0): Loading from cache
  - Installing doctrine/cache (v1.6.2): Loading from cache
  - Installing doctrine/annotations (v1.4.0): Loading from cache
  - Installing doctrine/common (v2.7.3): Loading from cache
  - Installing symfony/polyfill-mbstring (v1.7.0): Loading from cache
  - Installing symfony/yaml (v3.4.4): Loading from cache
  - Installing symfony/webpack-encore-pack (v1.0.2): Loading from cache
  - Installing psr/link (1.0.0): Loading from cache
  - Installing fig/link-util (1.0.0): Loading from cache
  - Installing symfony/web-link (v3.4.4): Loading from cache
  - Installing symfony/filesystem (v3.4.4): Loading from cache
  - Installing symfony/config (v3.4.4): Loading from cache
  - Installing symfony/http-foundation (v3.4.4): Loading from cache
  - Installing symfony/event-dispatcher (v3.4.4): Loading from cache
  - Installing psr/log (1.0.2): Loading from cache
  - Installing symfony/debug (v3.4.4): Loading from cache
  - Installing symfony/http-kernel (v3.4.4): Loading from cache
  - Installing psr/container (1.0.0): Loading from cache
  - Installing symfony/dependency-injection (v3.4.4): Loading from cache
  - Installing egulias/email-validator (2.1.3): Loading from cache
  - Installing swiftmailer/swiftmailer (v6.0.2): Loading from cache
  - Installing symfony/swiftmailer-bundle (v3.2.0): Loading from cache
  - Installing symfony/translation (v3.4.4): Loading from cache
  - Installing symfony/validator (v3.4.4): Loading from cache
  - Installing symfony/serializer (v3.4.4): Loading from cache
  - Installing symfony/inflector (v3.4.4): Loading from cache
  - Installing symfony/property-info (v3.4.4): Loading from cache
  - Installing symfony/property-access (v3.4.4): Loading from cache
  - Installing psr/simple-cache (1.0.0): Loading from cache
  - Installing psr/cache (1.0.1): Loading from cache
  - Installing symfony/polyfill-apcu (v1.7.0): Loading from cache
  - Installing symfony/cache (v3.4.4): Loading from cache
  - Installing webmozart/assert (1.3.0): Loading from cache
  - Installing phpdocumentor/reflection-common (1.0.1): Loading from cache
  - Installing phpdocumentor/type-resolver (0.4.0): Loading from cache
  - Installing phpdocumentor/reflection-docblock (4.3.0): Loading from cache
  - Installing symfony/serializer-pack (v1.0.1): Loading from cache
  - Installing symfony/security (v3.4.4): Loading from cache
  - Installing symfony/security-bundle (v3.4.4): Loading from cache
  - Installing symfony/process (v3.4.4): Loading from cache
  - Installing monolog/monolog (1.23.0): Loading from cache
  - Installing symfony/monolog-bridge (v3.4.4): Loading from cache
  - Installing symfony/monolog-bundle (v3.1.2): Loading from cache
  - Installing symfony/routing (v3.4.4): Loading from cache
  - Installing symfony/finder (v3.4.4): Loading from cache
  - Installing symfony/class-loader (v3.4.4): Loading from cache
  - Installing symfony/framework-bundle (v3.4.4): Loading from cache
  - Installing symfony/console (v3.4.4): Loading from cache
  - Installing zendframework/zend-eventmanager (3.2.0): Loading from cache
  - Installing zendframework/zend-code (3.1.0): Loading from cache
  - Installing ocramius/proxy-manager (2.0.4): Loading from cache
  - Installing doctrine/dbal (v2.5.13): Loading from cache
  - Installing doctrine/migrations (v1.5.0): Loading from cache
  - Installing symfony/doctrine-bridge (v3.4.4): Loading from cache
  - Installing doctrine/doctrine-cache-bundle (1.3.2): Loading from cache
  - Installing jdorn/sql-formatter (v1.2.17): Loading from cache
  - Installing doctrine/doctrine-bundle (1.8.1): Loading from cache
  - Installing doctrine/doctrine-migrations-bundle (v1.3.1): Loading from cache
  - Installing doctrine/instantiator (1.0.5): Loading from cache
  - Installing doctrine/orm (v2.5.14): Loading from cache
  - Installing symfony/orm-pack (v1.0.5): Loading from cache
  - Installing symfony/options-resolver (v3.4.4): Loading from cache
  - Installing symfony/polyfill-intl-icu (v1.7.0): Loading from cache
  - Installing symfony/intl (v3.4.4): Loading from cache
  - Installing symfony/form (v3.4.4): Loading from cache
  - Installing symfony/expression-language (v3.4.4): Loading from cache
  - Installing symfony/var-dumper (v3.4.4): Loading from cache
  - Installing symfony/phpunit-bridge (v3.4.4): Loading from cache
  - Installing twig/twig (v2.4.4): Loading from cache
  - Installing symfony/twig-bridge (v3.4.4): Loading from cache
  - Installing symfony/web-profiler-bundle (v3.4.4): Loading from cache
  - Installing symfony/twig-bundle (v3.4.4): Loading from cache
  - Installing symfony/stopwatch (v3.4.4): Loading from cache
  - Installing symfony/profiler-pack (v1.0.3): Loading from cache
  - Installing easycorp/easy-log-handler (v1.0.4): Loading from cache
  - Installing symfony/debug-bundle (v3.4.4): Loading from cache
  - Installing symfony/debug-pack (v1.0.4): Loading from cache
  - Installing symfony/asset (v3.4.4): Loading from cache
  - Installing sensio/framework-extra-bundle (v5.1.6): Loading from cache
  - Installing symfony/dom-crawler (v3.4.4): Loading from cache
  - Installing symfony/browser-kit (v3.4.4): Loading from cache
  - Installing symfony/css-selector (v3.4.4): Loading from cache
  - Installing symfony/dotenv (v3.4.4): Loading from cache
  - Installing symfony/maker-bundle (v1.1.1): Loading from cache
Writing lock file
Generating autoload files
ocramius/package-versions:  Generating version class...
ocramius/package-versions: ...done generating version class
Symfony operations: 20 recipes (2f96d696d346819d6ba100d95252f4e1)
  - Configuring symfony/flex (>=1.0): From github.com/symfony/recipes:master
  - Configuring symfony/framework-bundle (>=3.3): From github.com/symfony/recipes:master
  - Configuring doctrine/annotations (>=1.0): From github.com/symfony/recipes:master
  - Configuring symfony/webpack-encore-pack (>=1.0): From github.com/symfony/recipes:master
  - Configuring symfony/swiftmailer-bundle (>=2.5): From github.com/symfony/recipes:master
  - Configuring symfony/translation (>=3.3): From github.com/symfony/recipes:master
  - Configuring symfony/security-bundle (>=3.3): From github.com/symfony/recipes:master
  - Configuring symfony/monolog-bundle (>=3.1): From github.com/symfony/recipes:master
  - Configuring symfony/routing (>=3.3): From github.com/symfony/recipes:master
  - Configuring symfony/console (>=3.3): From github.com/symfony/recipes:master
  - Configuring doctrine/doctrine-cache-bundle (>=1.3.2): From auto-generated recipe
  - Configuring doctrine/doctrine-bundle (>=1.6): From github.com/symfony/recipes:master
  - Configuring doctrine/doctrine-migrations-bundle (>=1.2): From github.com/symfony/recipes:master
  - Configuring symfony/phpunit-bridge (>=3.3): From github.com/symfony/recipes:master
  - Configuring symfony/web-profiler-bundle (>=3.3): From github.com/symfony/recipes:master
  - Configuring symfony/twig-bundle (>=3.3): From github.com/symfony/recipes:master
  - Configuring easycorp/easy-log-handler (>=1.0): From github.com/symfony/recipes:master
  - Configuring symfony/debug-bundle (>=3.3): From github.com/symfony/recipes:master
  - Configuring sensio/framework-extra-bundle (>=4.0): From github.com/symfony/recipes:master
  - Configuring symfony/maker-bundle (>=1.0): From github.com/symfony/recipes:master
Executing script cache:clear [KO]
 [KO]
Script cache:clear returned with error code 1
!!  
!!  In Kernel.php line 865:
!!                                                                                 
!!    Warning: unlink(/home/fmk/Code/test/var/cache/dev/ContainerS8fduda.legacy):  
!!     No such file or directory                                                   
!!                                                                                 
!!  
!! 

即使打电话时php bin/console cache:clear我犯了同样的错误:

php bin/console cache:clear

In Kernel.php line 865:

  Warning: unlink(/home/fmk/Code/test/var/cache/dev/ContainerS8fduda.legacy): No such file or directory  

即使删除了文件/文件夹后var/cache手动然后再次尝试清除缓存,错误不会消失:

$ sudo rm -rf var/cache/*
$ php bin/console cache:clear

In Kernel.php line 865:

  Warning: unlink(/home/fmk/Code/test/var/cache/dev/ContainerS8fduda.legacy): No such file or directory

如果我尝试在应用程序中打开一条路线,我会得到与尝试调用时抛出的错误相同的错误cache:clear.

如果我尝试创建丢失的文件,它会抛出一个新错误,其中包含无法取消链接的新文件。这些是迄今为止出现的文件:

  • var/cache/dev/ContainerS8fduda.legacy
  • var/cache/de_
  • var/cache/de~
  • var/cache/de_/ContainerS8fduda.legacy
  • ...

我不知道还能做什么来让应用程序运行......

有谁知道如何解决这个问题?

Thanks!

UPDATE:我创建了一个 shell 脚本来创建所有“丢失”的文件:

#!/bin/bash

rm -rf var/cache/*

mkdir var/cache/dev
touch var/cache/dev/ContainerToyerun.legacy
touch var/cache/dev/ContainerToyerun.legacy
touch var/cache/de~
mkdir var/cache/de_
touch var/cache/de_/ContainerToyerun.legacy

这让我能够对应用程序发出一个请求,但之后ContainerToyerun.legacy文件有一个新名称,我需要编辑新请求的脚本!


删除供应商/并重新安装作曲家不会解决问题, 通过在 php.ini(或 20-xdebug.ini 符号链接到 /etc/php/(YOUR PHP VERSION)/mods-available/xdebug.ini 中禁用 xdebug.scream 可以解决此问题 )

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Symfony 4 缓存:没有这样的文件或目录 的相关文章

  • 关于如何在 PHPUnit 中使用 setUp() 和tearDown() 有真实的例子吗?

    Methods setUp and tearDown 在每次测试之前和之后调用 但实际上 有没有任何真实的例子说明我为什么需要这个 检查其他人的测试 我总是看到类似的东西 public function setUp this gt test
  • Drupal 模板/主题资源或建议?

    我有兴趣为我正在开发的 Drupal 网站创建自定义主题 我是 Drupal 的新手 但是我在处理构建主题 CSS PHP HTML 所需的基本概念方面拥有相当多的经验 所以 我的问题是 我从哪里开始 有创建 Drupal 主题的规范指南吗
  • SplFileObject + LimitIterator + 偏移量

    我有两行数据文件 两行仅用于我的示例 实际上 该文件可以包含数百万行 并且我使用 SplFileObject 和 LimitIterator 进行偏移 但这种组合在某些情况下会有奇怪的行为 offset 0 file new SplFile
  • 我无法访问 XAMPP phpMyAdmin;它说:错误 MySQL 说:文档无法连接:无效设置

    完整错误消息 Error MySQL said Documentation Cannot connect invalid settings Connection for controluser as defined in your conf
  • 在 csv 中查找数值

    我需要检查特定的数字 ID 是否在给定的字符串或逗号分隔值中 myVal 20 字符串可以仅包含多个值中的一个值 以逗号分隔 str 20 str 20 33 5 str 220 33 5 4420 本来我想到用strpos 但是20可以在
  • PHP 联系表单未提交

    您好 我之前曾成功使用过这个非常简单的 php 联系脚本 但当我尝试在新的 HTML 页面上实现它时 表单不会提交 任何人都可以看到任何明显的错误吗 任何帮助将非常感激 这是表单的 html div div
  • PHP 下载页面

    这些 PHP 下载页面 例如 somesite com download php id somefile 通常如何工作 我最初想到了一个执行计数器操作的页面 然后简单地将用户重定向到文件 URL 这似乎是其他地方给出的唯一答案 但是我不知道
  • 如何在使用 echo 时将字符串与函数调用连接起来?

    我想在我的 echo ed html 字符串中使用两个函数调用返回的值 li a href the permalink the title a li 以下工作正常 echo li a href echo the title echo a l
  • 550 Bad HELO - 主机冒充域名 Laravel

    我正在尝试设置 Laravel 身份验证 包括 密码重置 功能 但当我尝试发送电子邮件时 我偶然发现了一个错误 我得到的错误是 Expected response code 250 but got code 550 with message
  • 有没有办法通过给出整数值 PHP 来获取月份名称

    您好 我正在使用 PHP 我想传递一个整数值 1 12 并获取相应的月份名称 PHP 中有没有办法做到这一点 或者我必须通过初始化月份名称数组来完成自己的操作 我想做 month name get month name 1 echo mon
  • 访问php数组内部[关闭]

    Closed 这个问题需要调试细节 help minimal reproducible example 目前不接受答案 我有一个像这样的数组打印 array 2 systems gt array 5 1 gt string 1 1111 2
  • 如何在 Yii 框架中从数据库中获取所有表名和列名

    我正在开发一个模块 我想在其中执行动态相关下拉表和列名称功能 前任 获取所有表名称并将其显示在下拉字段中 选择特定表后 我想在下拉字段中再次显示其所有列名称 问题是 1 如何从数据库中获取所有表名 2 如何从表中获取所有列名 我尝试了一些文
  • 在 Laravel Schema 中创建价格列

    我想在 Laravel 模式中创建一个价格列 public function up Schema create cameras function Blueprint table table gt increments id table gt
  • 无法在 Symfony2 中上传 mime 类型“application/octet-stream”的图像

    我来说说这个问题吧 我有一个名为 图像 的表格 它包含一个名为 file 的字段 并作为图像实现进行检查 这是validation yml的一部分 noxaeterna MainBundle Model Image constraints
  • PHP字符串比较和相似度索引

    在 PHP 中 有什么优雅的代码可以在两个字符串中查找公共字母而不包含空格 还返回相似性索引 即计算常见字符的数量并返回占字符总数的百分比 假设我有一个字符串 LEGENDARY 而其他字符串为 BARNEY STINSON 所以我需要找到
  • 基于 ajax 的弹出窗口中的 Mathjax + CKEditor 4 + CKEditor

    我已经配置了 CKEditor 4 并且我的页面上有以下内容 我的页面中有一个 CKEditor 设置值的两个选项 这两个选项本身分别选项两个基于 ajax 的弹出窗口 这些基于 ajax 的弹出窗口包含 CKEditor 现在我有以下问题
  • PHP 插入中的 mysqli_affected_rows

    我有这个代码 if mail to subject message headers insert member sql INSERT INTO members id username VALUES id username insert me
  • 当我在 PHP 中将 print_r() 应用于数组时,为什么会得到“Resource id #4”? [复制]

    这个问题在这里已经有答案了 可能的重复 我如何从 PHP 中的 MySql 响应中 回显 资源 id 6 https stackoverflow com questions 4290108 how do i echo a resource
  • Codeigniter,为MySQL创建表和用户

    我想以编程方式使用 CI 创建数据库和用户 到目前为止 我有这 2 个简单的 MySQL 语句 CREATE DATABASE testdb DEFAULT CHARACTER SET utf8 COLLATE utf8 general c
  • 手动渲染 Twig 字符串时禁用 HTML 转义

    我有以下代码将字符串呈现为 HTML 输出 如何阻止它转义 HTML 文本 template who bar params array who gt Foo s twig new Twig Environment new Twig Load

随机推荐