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

独自空忆成欢 提交于 2020-01-12 07:18:03

问题


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

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.


回答1:


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

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.




回答2:


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

Works after:

  1. install php-xml (can be optionally compiled with this option I suppose)
  2. set date.timezone in /etc/php.ini



回答3:


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

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

Then it worked :)




回答4:


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

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

<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.phar inside your symfony-cmf-standard folder and run with administrator privileges the command:

php composer.phar update



回答5:


Make sure these are installed:

  • php-mb or php54w-mbstring or php55w-mbstring
  • php-xml or php54-xml or php55w-xml


来源:https://stackoverflow.com/questions/14893082/an-error-occured-when-executing-the-cacheclear-no-warmup-while-installing-s

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!