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     }
3
  • 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) Commented Mar 29, 2012 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. Commented Mar 30, 2012 at 7: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. Commented Apr 2, 2012 at 19:34

3 Answers 3

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
Sign up to request clarification or add additional context in comments.

2 Comments

phpfog.com is our host, and they have an utility for setting permissions. I set the permissions of the "protected" folder to be writeable by the seb server, but I still get the same error.
Okay, now you need to set them on the runtime folder.
0

Have you got a firewall running?

Maybe it's preventing write access?

Comments

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'

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.