php - Cakephp could not create tmp folder -
i'm using vagrant setup centos 6.6 x86_64 virtual os. have installed apache , cakephp it.
i have let apache run vagrant user , in vagrant group. , vagrant's vagrantfile
has line config.vm.synced_folder "./gym", "/var/www", mount_options: ["dmode=777", "fmode=777"]
.
after run index.php, cakephp report error:
php warning: /var/www/gym_new/app/tmp/cache/persistent/ not writable in /var/www/cake_2_6/cake/cache/engine/fileengine.php on line 385
php warning: _cake_core_ cache unable write 'file_map' file cache in /var/www/cake_2_6/cake/cache/cache.php on line 328
so open fileengine.php
there code trigger error:
/** * determine cache directory writable * * @return bool */ protected function _active() { $dir = new splfileinfo($this->settings['path']); if (configure::read('debug')) { $path = $dir->getpathname(); if (!is_dir($path)) { mkdir($path, 0775, true); } } if ($this->_init && !($dir->isdir() && $dir->iswritable())) { $this->_init = false; trigger_error(__d('cake_dev', '%s not writable', $this->settings['path']), e_user_warning); return false; } return true; }
i think permission has no problem create brand new php under webroot:
$path = "/var/www/gym_new/app/tmp/cache/"; if(mkdir($path, 0775, true) && is_dir($path) && is_writable($path)) { echo "true"; } else { echo "false"; $error = error_get_last(); echo $error['message']; }
my code runs perfect , folders (tmp , cache) created successful. same code in cakephp cannot go through. there have missed? the cakephp file outside of webroot, dose cause problem ?
the problem if (configure::read('debug'))
.
i found haven't set debug non-zero value, cakephp won't create folders don't exist.
Comments
Post a Comment