我尝试使用 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
文件有一个新名称,我需要编辑新请求的脚本!