php 安装 symfony-cmf-standard 时“执行缓存时发生错误:clear --no-warmup”

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/14893082/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 08:08:22  来源:igfitidea点击:

"An error occured when executing the cache:clear --no-warmup" while installing symfony-cmf-standard

phpsymfonysymfony-cmf

提问by vishal

I was trying to install symfony-cmf-standard using:

我试图使用以下方法安装 symfony-cmf-standard:

composer.phar create-project symfony-cmf/standard-edition symfony-cmf-standard/ --stability=dev

But I am getting the following error:

但我收到以下错误:

Could not open input file: app/console
Script sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache handling the post-install-cmd event terminated with an exception

[RuntimeException]
An error occured when executing the cache:clear --no-warmup

I am running the command as an Administrator so it should not be a permission issue.

我以管理员身份运行命令,所以它不应该是权限问题。

回答by vishal

It gives error as when we use the command,

当我们使用命令时,它会出错,

composer.phar create-project symfony-cmf/standard-edition symfony-cmf-standard/ --stability=dev

It creates symfony-cmf-standard folder as a project folder and starts installing dependencies but in between it tries to clear cache using

它创建 symfony-cmf-standard 文件夹作为项目文件夹并开始安装依赖项,但在两者之间它尝试使用清除缓存

php app/console cache:clear

But as the current location is outside of the project folder it can not locate app/console so it fails.

但是由于当前位置在项目文件夹之外,它无法找到应用程序/控制台,所以它失败了。

Now if we change the directory to inside the project folder and clear cache manually by using command

现在,如果我们将目录更改为项目文件夹内并使用命令手动清除缓存

php app/console cache:clear 

It clears cache and then we need to again update dependencies using

它清除缓存,然后我们需要再次使用更新依赖项

php composer.phar update 

It worked for me.

它对我有用。

回答by Alex

I've got an error cut also in the same case: "...PHP Fatal error: Class 'DOMDocument' not found..."

在同样的情况下,我也有一个错误:“...PHP 致命错误:找不到类 'DOMDocument'...”

Works after:

工作后:

  1. install php-xml(can be optionally compiled with this option I suppose)
  2. set date.timezonein /etc/php.ini
  1. install php-xml(我想可以选择使用此选项编译)
  2. 设置date.timezone/etc/php.ini

回答by Ssh-uunen

On my side with php7.0 I had to install :

在我的 php7.0 这边,我必须安装:

  • php7.0-mbstring
  • php7.0-xml
  • php7.0-mbstring
  • php7.0-xml

Then it worked :)

然后它起作用了:)

回答by cheesemacfly

This happens because of the following bug in DoctrinePHPCRBundle: https://github.com/doctrine/DoctrinePHPCRBundle/issues/17

这是因为 DoctrinePHPCRBundle 中的以下错误:https: //github.com/doctrine/DoctrinePHPCRBundle/issues/17

To fix it, edit the file vendor/doctrine/phpcr-bundle/Doctrine/Bundle/PHPCRBundle/Resources/config/odm.xmlinside your symfony-cmf-standardfolder and replace this line:

为了解决这个问题,编辑该文件vendor/doctrine/phpcr-bundle/Doctrine/Bundle/PHPCRBundle/Resources/config/odm.xml的内部symfony-cmf-standard文件夹,替换该行:

<parameter key="doctrine_phpcr.odm.metadata.driver_chain.class">Doctrine\ODM\PHPCR\Mapping\Driver\DriverChain</parameter>

With this one:

有了这个:

<parameter key="doctrine_phpcr.odm.metadata.driver_chain.class">Doctrine\Common\Persistence\Mapping\Driver\MappingDriverChain</parameter>

Now copy composer.pharinside your symfony-cmf-standardfolder and run with administrator privileges the command:

现在复制composer.phar到您的symfony-cmf-standard文件夹中并以管理员权限运行以下命令:

php composer.phar update

回答by Michael Stramel

Make sure these are installed:

确保安装了这些:

  • php-mbor php54w-mbstringor php55w-mbstring
  • php-xmlor php54-xmlor php55w-xml
  • php-mbphp54w-mbstringphp55w-mbstring
  • php-xmlphp54-xmlphp55w-xml