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 缓存:没有这样的文件或目录 的相关文章

  • 如何从 Laravel 中的表中选择所有列名称?

    我试图从表中获取所有列名Teller 功能 public function getTableColumns tables return DB select DB raw SELECT COLUMN NAME DATA TYPE COLUMN
  • Zend Framework 生成唯一的字符串

    我想生成一个唯一的 4 6 个字符长的字母数字字符串 以便与每个记录 用户 一起保存在数据库中 db 字段具有唯一索引 因此尝试保存预先存在的字符串会生成错误 现在我正在生成一个随机字符串并使用 try catch 因此在添加新记录时如果抛
  • 简单的 PHP 条件帮助: if($Var1 = in list($List) and $Cond2) - 这可能吗?

    这是一个可能的功能吗 我需要检查一个变量是否存在于我需要检查的变量列表中 并且 cond2 是否为 true 例如 if row name 1 2 3 Cond2 doThis 它对我不起作用 我在复制粘贴中更改的只是我的列表和变量名称 i
  • 通过 Ajax 加载内容时,WORDPRESS 音频播放器未加载,MediaElement.js 未应用

    我正在创建一个 WordPress 主题 当我使用 ajax 加载内容时 它不会将 MediaElements js 应用于我的音频播放器 因此不会显示音频 我认为这是因为 MediaElement js 加载了 wp footer 并且此
  • 如何使用 phpunit 运行单个测试方法?

    我正在努力运行一个名为testSaveAndDrop在文件中escalation EscalationGroupTest php with phpunit 我尝试了以下组合 phpunit EscalationGroupTest escal
  • 如何检查PHP变量是否包含非数字?

    我只是想知道检查 PHP 变量中是否有非数字的方法以及它是否也检测字符之间的空格 需要确保我的表单字段中没有添加任何奇怪的内容 提前致谢 如果您的意思是您只想要一个包含数字的值 那么您可以使用ctype digit http php net
  • 如何使用变量处理树枝文件中的翻译?

    我有一个 twig 文件和一个 yml 在其中定义翻译变量 e g YML 文件 variable for translation Disponible para t Twig 文件的内容 h2 Hola Follow variableNa
  • 如何在响应ajax codeigniter后停止执行其他控制器

    我想知道如何在响应输出 json 数据后停止执行函数和涉及的其他控制器 就我这里的情况而言 我只是打电话test 函数于dashboard控制器 In dashboard构造函数将执行MY Login library In MY Login
  • PHP严格标准:声明应该兼容

    我有以下类层次结构 class O Base class O extends O Base abstract class A Abstract public function save O Base obj class A extends
  • 蛋糕控制台 2.2.1:烘焙错误

    运行 MAMP 的 OSX 机器 CakePHP 2 2 1 已正确安装和配置 这意味着当我浏览到 Index php 文件时 所有绿色条都显示出来 我已经完成了博客教程 并且正在开发我的第二个应用程序 其中脚手架已启动并运行 现在我第一次
  • 使用 preg_replace 仅替换第一个匹配项

    我有一个结构类似于以下的字符串 aba aaa cba sbd dga gad aaa cbz 该字符串每次都可能有点不同 因为它来自外部源 我只想替换第一次出现的 aaa 但其他人则不然 是否可以 可选的第四个参数预替换 http php
  • 学说迁移后备

    我们正在使用原则迁移 当迁移包含多个操作并且其中一个操作失败时 通常会出现问题 例如 如果迁移添加了 5 个外键 其中第 5 个失败 而字段长度不同 则修复字段错误并重新生成迁移不会not修复整个问题 而现在出现一个与 4 个密钥已存在有关
  • PHP 在输入流中使用 fwrite 和 fread

    我正在寻找将 PHP 输入流的内容写入磁盘的最有效方法 而不使用授予 PHP 脚本的大量内存 例如 如果可以上传的最大文件大小为 1 GB 但 PHP 只有 32 MB 内存 define MAX FILE LEN 1073741824 1
  • 在 Wordpress 站点中进行 AJAX 调用时出现问题

    我在使用 Wordpress 站点功能的 AJAX 部分时遇到了一些问题 该功能接受在表单上输入的邮政编码 使用 PHP 函数来查找邮政编码是否引用特定位置并返回到该位置的永久链接 我的第一个问题是关于我构建的表单 现在我的表单操作是空白的
  • PHP 与 MySQL 查询性能( if 、 函数 )

    我只看到这个artice http www onextrapixel com 2010 06 23 mysql has functions part 5 php vs mysql performance 我需要知道在这种情况下什么是最好的表
  • PHP preg_filter 返回意外的长值

    尝试在 Woocommerce 中删除标签并过滤值 但无法以正确的格式获取它 有东西有腥味 我正在使用WC gt cart gt get cart subtotal 来检索该值 在此示例中 我的值是 2 429kr 原始返回值是 span
  • 跟踪用户何时点击浏览器上的后退按钮

    是否可以检测用户何时单击浏览器的后退按钮 我有一个 Ajax 应用程序 如果我可以检测到用户何时单击后退按钮 我可以显示适当的数据 任何使用 PHP JavaScript 的解决方案都是优选的 任何语言的解决方案都可以 只需要我可以翻译成
  • PHP HEREDoc (EOF) 语法在 Sublime Text 3 上突出显示与正斜杠的差异

    我不熟悉 Sublime Text 3 如何使用语法突出显示 例如 如果它纯粹依赖于主题 或者它内置于主题运行的标准中 但就我而言 使用 PHP 的 HERE 文档和转发存在一些语法突出显示差异斜线 一旦出现正斜杠 ST3 就会认为以下所有
  • php 错误 fopen(): 文件名不能为空

    发送带有附件代码的电子邮件工作正常 最近我们已将文件传输到另一个托管服务器 idk 发生了什么 它显示以下错误 警告 fopen 第 106 行 home hugerecruitmetnt public html validatecva p
  • 使用正则表达式提取两个短语之间的所有单词[重复]

    这个问题在这里已经有答案了 我正在尝试使用以下正则表达式提取两个短语之间的所有单词 b item W w W 0 2 1 one W w W 0 3 business b b item W w W 0 2 3 three W w W 0 3

随机推荐