10

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.

vishal
  • 3,993
  • 14
  • 59
  • 102

6 Answers6

12

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.

vishal
  • 3,993
  • 14
  • 59
  • 102
6

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
Abdulla Nilam
  • 36,589
  • 17
  • 64
  • 85
Alex
  • 1,297
  • 1
  • 16
  • 12
  • 1
    Damn it. I forgot about that xml package. Thanks! After `sudo apt-get install php7.1-xml` the `composer install` worked absolutely perfect (I am working on a Ubuntu 16.04.2 LTS with PHP-7.1 by the way, but should also work on other distributions as well). – Arvid Mar 29 '17 at 08:47
  • brilliant, you saved my day! – Fernando Tan Sep 24 '17 at 22:50
2

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

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

Then it worked :)

Ssh-uunen
  • 313
  • 1
  • 9
1

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
cheesemacfly
  • 11,622
  • 11
  • 53
  • 72
  • in vendor/doctrine/phpcr-bundle/Doctrine/Bundle/PHPCRBundle/Resources/config/odm.xml file there is already, Doctrine\Common\Persistence\Mapping\Driver\MappingDriverChain still it gives same error. – vishal Feb 19 '13 at 06:38
1

Make sure these are installed:

  • php-mb or php54w-mbstring or php55w-mbstring
  • php-xml or php54-xml or php55w-xml
Michael Stramel
  • 1,337
  • 1
  • 16
  • 18
0

After spending a couple hours on the issue, under FreeBSD you need to install port textproc/php80-xmlreader as well.

Fabian Pijcke
  • 2,920
  • 25
  • 29