Install Symfony2 Composer

I am trying to install Symfony 2.1.3 (latest). Iโ€™m running a composer and getting things going. The only error I get is:

Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache handling the post-install-cmd event terminated with an exception [RuntimeException] An error occurred when executing the "'cache:clear --no-warmup'" command. 

It is installed in the www folder. I run nginx and follow the composer approach. I read on the Internet that apache should not be started manually as a service, but instead I use nginx. Is Apache still relevant? I am using debian squeeze.

Edit: as suggested by AdrienBrault, the error was that the time zone was not set in php.ini. Only with --verbose could I see a warning. Thanks guys.

+5
source share
4 answers

Apache is not bound - PHP is invoked through the command line.

Most likely, this permission is in the cache folder: you checked if the user performing the composer update can write the cache folder?

Try manually running rm -Rf app/cache/dev (for a production environment, replace dev with prod) and see if you have any permission error.

You will also get this error if the default.timezone parameter is not configured in php when running in the CLI. To check only start

php --info | grep timezone

and check if the date.timezone setting is date.timezone .

On the security side, installing 777 in a folder is not the best solution - if you have enabled the ACL, you can use this to correctly configure the permission for the cache folder and logs. Read more on the official Symfony2 installation page

+7
source

I had the same problem for a while, and after an hour of collisions with a brick wall, I realized ... I have a .gitmodule project in my project, and during the initial check these submodules are NOT initialized and as such do not exist for your composer to be updated, which leads to the above error.

Make sure you use the following

 git submodule update --init src/Acme/Sadness/Bundle 

Of course, replace src / Acme / Sadness / Bundle with your project namespace.

Hope this helps someone not to go through the same pain as me.

+1
source

If you already have a provider folder, I would delete it and install symfony 2.1.3 again through "composer.phar install". The problem may come from an outdated composer version.

0
source

I had the same problem and solved it this way.

execute this on the console and you should see something like this

 $ locate php.ini /etc/php5/apache2/php.ini /etc/php5/cli/php.ini /etc/php5/fpm/php.ini 

the first line is probably your php.ini, which appears when you do phpinfo ();

the problem is that when you perform a composer update, do not check the same php.ini

in my case the second line

all my sites work fine, but always I had problems not now after editing the second file and set the same time zone that you set in the first

run

 $ sudo service apache2 reload 

and now

 $ composer update 

I hope this work is for you, as work for me

Regards Emiliano

0
source

All Articles