On Mon, Sep 10, 2012 at 11:14 AM, Oscar Fanelli
<[hidden email]> wrote:
Hi all, I received an exception when I tried to flush the filesystem cache from a Zend\Console action.
$cache = new \Zend\Cache\Storage\Adapter\Filesystem();
$cache->setOptions(array('cacheDir' => \Gamempire\Entity\Image::IMAGES_DIR_CACHE));
$cache->flush();
======================================================================
The application has thrown an exception!
======================================================================
Zend\Cache\Exception\RuntimeException
Flushing directory '/xxx/data/cache/images' failed
If i do it from a normal action and an http request, all is working fine.
Do you know if it's a bug?
I don't believe it's got anything to do with console per se.
I'd bet on paths. When running on a web server, the base path might (should) be the
main app dir. When running from console you might invoke your script from some other
directory and use relative paths in your configs.
- Check your relative paths.
- Check if you're running your app from a proper path (or if you chdir() to it in the main script)
- Check your permissions (different user running web server, different user in console)
- Check permissions against file owner (cache files created by web server, trying to delete by
some other user without write permission)
--
__
/.)\ +48 695 600 936
\(./ [hidden email]