LoginSignup
0
0

More than 5 years have passed since last update.

CakePHPでWarning:SqlFileinfo::opneFileエラー

Last updated at Posted at 2016-09-10
Warning: SplFileInfo::openFile(/path/to/app/tmp/cache/persistent/~)[splfileinfo.openfile]: failed to open stream: Permission denied in (/path/to/lib/Cake/Cache/Engine/FileEngine.php on line xxx

対処法

bootstrap.php
Cache::config('default', array('engine' => 'File', 'mask' => 0666));
core.php
Cache::config('_cake_core_', array(
    'engine' => $engine,
    'prefix' => $prefix . 'cake_core_',
    'path' => CACHE . 'persistent' . DS,
    'serialize' => ($engine === 'File'),
    'duration' => $duration,
    'mask' => 0666
));
Cache::config('_cake_model_', array(
    'engine' => $engine,
    'prefix' => $prefix . 'cake_model_',
    'path' => CACHE . 'models' . DS,
    'serialize' => ($engine === 'File'),
    'duration' => $duration,
    'mask' => 0666
));

するとcacheに生成されるファイルが、-rw-rw-rw- になる。
勿論前提として、tmp/cache、tmp/cache、tmp/cache/models、/tmp/cache/persistentsなどのパーミッションも正しく設定しておく。

参考:http://log.miraoto.com/2012/09/675/

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0