4

I'm trying to implement a little default application that comes with yii framework on phpfog. I've installed it according to the instructions using GIT. Now, when I try to run it, I get this error (below). I've checked to make sure that the directory is writeable and that the directory called for does exists. I'm stuck, what do I do next?

Application runtime path      /var/fog/apps/app35423/austintxous.phpfogapp.com/demos/emp/protected/runtime" is not valid.     
Please make sure it is a directory writable by the Web server process.
259             return $this->_runtimePath;
260         }
261     }
262 
263     /**
264      * Sets the directory that stores runtime files.
265      * @param string $path the directory that stores runtime files.
266      * @throws CException if the directory does not exist or is not writable
267      */
268     public function setRuntimePath($path)
269     {
270         if(($runtimePath=realpath($path))===false || !is_dir($runtimePath) ||     
!is_writable($runtimePath))
271             throw new CException(Yii::t('yii','Application runtime path "{path}" is 
not valid. Please make sure it is a directory writable by the Web server process.',
272                 array('{path}'=>$path)));
273         $this->_runtimePath=$runtimePath;
274     }
275 
276     /**

277      * Returns the root directory that holds all third-party extensions.
278      * @return string the directory that contains all extensions. Defaults to the  
'extensions' directory under 'protected'.
279      */
280     public function getExtensionPath()
281     {
282         return Yii::getPathOfAlias('ext');
283     }
David Newcomb
  • 10,639
  • 3
  • 49
  • 62
  • to debug some more, split if(($runtimePath=realpath($path))===false || !is_dir($runtimePath) || !is_writable($runtimePath)) into two if statements to see which part is failing: this $runtimePath=realpath($path))===false or this !is_dir($runtimePath) – sdjuan Mar 29 '12 at 19:47
  • directory is writeable by which user? Try changing the permissions to 777 (just for debugging) and check again. If it works, that means the write permissions are not for the correct user. – Mukesh Soni Mar 30 '12 at 07:16
  • I tried this, which gave me the result of Application runtime path "/var/fog/apps/app35423/austintxous.phpfogapp.com/demos/emp/protected/runtime" is not valid. Please make sure it is a directory writable by the Web server process. " However, the directory DOES EXIST at this location, as far as I can tell. By that, I mean, when I clone the repository locally, the directory is there. – I_miss_Steve_already Apr 02 '12 at 19:34

3 Answers3

1

The web server cannot write to the runtime directory. Make sure it exists, and change ownership of it to your web server, or set chmod 777 (which is a fine solution if it's your dev environment).

cd [project directory]
chmod 777 protected/runtime
deepwell
  • 20,195
  • 10
  • 33
  • 39
0

Have you got a firewall running?

Maybe it's preventing write access?

Mr Goobri
  • 1,449
  • 5
  • 19
  • 42
0

you must config with semanage like this which allow php-fpm write access to directory

# semanage fcontext -a -t httpd_sys_rw_content_t 'YOUR_PATH_HERE'
# restorecon -v 'YOUR_PATH_HERE'