2013-08-26 38 views
1

我已經安裝了Symfony 2,並且我已經激活了opcache(ZendOPtimizer)擴展名,當我打算生成網頁的緩存O've得到這個錯誤:Symfony 2 | OPcache |警告:filemtime():stat FileCacheReader.php中的Acme-DemoBundle-Controller-SecuredController.cache.php失敗

Warning: filemtime(): stat failed for C:/Apache24/htdocs/symfony/app/cache/dev/annotations/Acme-DemoBundle-Controller-SecuredController.cache.php in C:\Apache24\htdocs\symfony\vendor\doctrine\common\lib\Doctrine\Common\Annotations\FileCacheReader.php line 97 

這是我opcache配置:

zend_extension="c:\php\ext\php_opcache.dll" 
opcache.enable=1 
opcache.use_cwd=0 
opcache.validate_timestamps=0   ; file stat 
opcache.revalidate_freq=2 ; seconds 
opcache.revalidate_path=0 
opcache.save_comments=0 
opcache.load_comments=0 
opcache.dups_fix=0 
opcache.inherited_hack=0 
opcache.log_verbosity_level=1 
opcache.memory_consumption=128 
opcache.interned_strings_buffer=8 
opcache.max_accelerated_files=4000 
opcache.enable_file_override=1 
opcache.max_wasted_percentage=5  ; percent waste until restart 
opcache.consistency_checks=0 
opcache.force_restart_timeout=180 
opcache.blacklist_filename=paypal.php 
opcache.fast_shutdown=1 
opcache.optimization_level=0xffffffff 
opcache.enable_slow_optimizations=1 
opcache.max_file_size=0 

當我禁用此擴展,高速緩存的一代作品

版本:

  • 的Symfony 2.3.3
  • PHP 5.5
  • 的Apache 2.4.6的Windows
+0

嘗試將opcache.save_comments切換爲1(也可能是load_comments),因爲Symfony使用註釋註釋。查看推薦的設置[這裏](https://raw.github.com/zendtech/ZendOptimizerPlus/master/README)。 – solarc

+0

-1對於使用Windows – mate64

回答

0

1 - 確保您已禁用APC或它會造成衝突。

2 - 確保在激活opcache後完全重新啓動apache。

4

我在我的Mac上有完全相同的問題,使用自制php55版本。 正如優化程序文檔中所述,選項opcache.enable_file_override = 1可能會破壞某些框架。 Symfony2似乎就是這種情況。將值切換爲0解決了問題。

+0

好的,謝謝我會測試什麼時候可以 – psylo66