7

I seem to be having some problems with cache permissions on shared hosting. Specifically, when I try to install/update vendors via Composer, I get a runtime exception:

$ php composer.phar update -v -o

Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache handling the post-update-cmd event terminated with an exception

[RuntimeException]
An error occurred when executing the "'cache:clear --no-warmup'" command.

Exception trace:
() at /home/thesewingdiva/private/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Composer/ScriptHandler.php:137
Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::executeCommand() at /home/thesewingdiva/private/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Composer/ScriptHandler.php:48
Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache() at phar:///home/thesewingdiva/private/composer.phar/src/Composer/Script/EventDispatcher.php:122
Composer\Script\EventDispatcher->executeEventPhpScript() at phar:///home/thesewingdiva/private/composer.phar/src/Composer/Script/EventDispatcher.php:101
Composer\Script\EventDispatcher->doDispatch() at phar:///home/thesewingdiva/private/composer.phar/src/Composer/Script/EventDispatcher.php:74
Composer\Script\EventDispatcher->dispatchCommandEvent() at phar:///home/thesewingdiva/private/composer.phar/src/Composer/Installer.php:237
Composer\Installer->run() at phar:///home/thesewingdiva/private/composer.phar/src/Composer/Command/UpdateCommand.php:82
Composer\Command\UpdateCommand->execute() at phar:///home/thesewingdiva/private/composer.phar/vendor/symfony/console/Symfony/Component/Console/Command/Command.php:238
Symfony\Component\Console\Command\Command->run() at phar:///home/thesewingdiva/private/composer.phar/vendor/symfony/console/Symfony/Component/Console/Application.php:193
Symfony\Component\Console\Application->doRun() at phar:///home/thesewingdiva/private/composer.phar/src/Composer/Console/Application.php:101
Composer\Console\Application->doRun() at phar:///home/thesewingdiva/private/composer.phar/vendor/symfony/console/Symfony/Component/Console/Application.php:106
Symfony\Component\Console\Application->run() at phar:///home/thesewingdiva/private/composer.phar/src/Composer/Console/Application.php:74
Composer\Console\Application->run() at phar:///home/thesewingdiva/private/composer.phar/bin/composer:37
require() at /home/thesewingdiva/private/composer.phar:15

update [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-custom-installers] [--no-scripts] [--no-progress] [-v|--verbose] [-o|--optimize-autoloader] [packages1] ... [packagesN]

I don't have the ability to use ACL, and I don't have the ability to use sudo since it's shared hosting. The cache is set to 777 for it's permissions (recursive), and app/console, app.php, and app_dev.php all have umask(0000). I've also erased the cache to see if that would help. No dice. Any ideas on how to fix this?

3
  • 2
    Are you sure it's a permission issue? Looking around, several Symfony users have reported a timezone setting fix. Commented Dec 30, 2012 at 17:01
  • What happens if you run cache:clear --no-warmup directly? With the --verbose option of the console executable? Commented Dec 30, 2012 at 17:10
  • @JaredFarrish Your suggestion did the trick! Thanks! Please make your comment an answer so I can upvote and mark it as solved. Commented Dec 31, 2012 at 15:34

3 Answers 3

4

In a comment under this question, it's pointed out that the issue has to do with a missing timezone setting.

What happens if you do "php app/console cache:clear --verbose"

Sign up to request clarification or add additional context in comments.

1 Comment

Same problem with me, no default timezone. When going to web/config.php there was a message saying something was outdated and advising to run "composer update" again. Once the default timezone was set, the command ran successfully.
2

I had this same issue for a while and after hours of face to brick wall pounding I realized... I have a .gitmodule in my project, and on initial checkout these submodules are NOT initialized and as such are not there for your composer to update, which results in the above error.

Make sure you run 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 go through the same pain I just did.

Comments

0

To find out exact reason for exception, see the php error logs. However, as mentioned by Jared Farrish, this could be due to not setting of timezone in php ini settings.

#/etc/php5/cli/php.ini
date.timezone = 'Asia/Kolkata'
log_errors = On
error_log = /var/log/php/error.log

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.