简体   繁体   English

Symfony2:产品中的PdfBundle导致缓存:清除失败

[英]Symfony2: PdfBundle in prod leads to cache:clear failure

Even with the PdfBundle vendor's suggested use of umask() the following occurs when attempting to clear cache in (shared host) prod environment if a PDF has been created. 即使使用PdfBundle供应商建议的umask()用法,如果已创建PDF,尝试在(共享主机)产品环境中清除缓存时,也会发生以下情况。 If a PDF has not been created, the error does not occur: 如果尚未创建PDF,则不会发生错误:

[UnexpectedValueException] [UnexpectedValueException]
FilesystemIterator::__construct(/home/projectmana/www2.projectmana.org/app/ cache/prod_old/zfcache-bd): failed to open dir: Permission denied FilesystemIterator :: __ construct(/home/projectmana/www2.projectmana.org/app/cache/prod_old/zfcache-bd):无法打开目录:权限被拒绝

directory listing is: 目录清单是:

drwx------   2 www-data    www-data      4096 Nov  9 17:15 zfcache-05
drwx------   2 www-data    www-data      4096 Nov  9 17:15 zfcache-18
drwx------   2 www-data    www-data      4096 Nov  9 17:15 zfcache-31
drwx------   2 www-data    www-data      4096 Nov  9 17:15 zfcache-bd

Is there a method in a shared host environment to eliminate this error? 共享主机环境中是否有消除此错误的方法?

The only feasible alternative in this instance was to add the ability to clear the prod cache in a controller. 在这种情况下,唯一可行的替代方法是添加清除控制器中产品缓存的功能。 This SO post was the easiest to implement. 这样的SO帖子是最容易实现的。 Note that in a shared host environment it takes the system administrator to clear prod* directories before the controller action could be effective. 请注意,在共享主机环境中,系统管理员必须先清除prod *目录,然后控制器操作才能生效。

Have you considered using another caching method like apc instead of files? 您是否考虑过使用apc等其他缓存方法代替文件?

ps_pdf:
    cache:
      type: apc

https://github.com/psliwa/PdfBundle#configuration https://github.com/psliwa/PdfBundle#configuration

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM