Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Symfony - can't clear cache through command

I'm working on a vagrant machine (Homestead). In my Homestead.yml I have:

sites:
  - map: myproject.local
    to: /home/vagrant/projects/myproject/web
    type: symfony

I'm working with Symfony version 3.3 on PHP 7.1.2.

The problem is when I try to execute the command php bin/console cache:clear I'm getting the following error:

[Symfony\Component\Filesystem\Exception\IOException] Failed to remove directory "/home/vagrant/projects/vkfilestore-code/var/cache/de~/pools": .

In my AppKernel.php I have:

public function getCacheDir()
{
    return dirname(__DIR__).'/var/cache/'.$this->getEnvironment();
}

When I dump $this->getEnvironment() it says dev.

What could be the problem here?

like image 437
nielsv Avatar asked Dec 07 '25 09:12

nielsv


1 Answers

This is a Virtual platform related issue.A simple workaround is to remove manually.

$ sudo rm -rf app/cache/*

Read more about this issue app/console cache:clear problem

like image 143
habibun Avatar answered Dec 08 '25 22:12

habibun



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!