Application runtime path " " is not valid.

Ok this is driving me nuts and I’m down to the wire can’t figure it out, so maybe someone around here has a clue that I’m missing haha.

Ok so here’s the error:





[b]CException[/b]


[b]Description[/b]

Application runtime path "/var/www/vhosts/albern.to/subdomains/yii/httpdocs/albern/protected/config/runtime" is not valid. Please make sure it is a directory writable by the Web server process.




[b]Source File[/b]

/var/www/vhosts/albern.to/subdomains/yii/httpdocs/yii/framework/base/CApplication.php(236)


00224:             $this->setRuntimePath($this->getBasePath().DIRECTORY_SEPARATOR.'runtime');

00225:             return $this->_runtimePath;

00226:         }

00227:     }

00228: 

00229:     /**

00230:      * @param string the directory that stores runtime files.

00231:      * @throws CException if the directory does not exist or is not writable

00232:      */

00233:     public function setRuntimePath($path)

00234:     {

00235:         if(($runtimePath=realpath($path))===false || !is_dir($runtimePath) || !is_writable($runtimePath))

00236:             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.',

00237:                 array('{path}'=>$path)));

00238:         $this->_runtimePath=$runtimePath;

00239:     }

00240: 

00241:     /**

00242:      * Returns the root directory that holds all third-party extensions.

00243:      * @return string the directory that contains all extensions. Defaults to the 'extensions' directory under 'protected'.

00244:      */

00245:     public function getExtensionPath()

00246:     {

00247:         return Yii::getPathOfAlias('ext');

00248:     }


[b]Stack Trace[/b]

#0 /var/www/vhosts/albern.to/subdomains/yii/httpdocs/yii/framework/base/CApplication.php(224): CApplication->setRuntimePath('/var/www/vhosts...')

#1 /var/www/vhosts/albern.to/subdomains/yii/httpdocs/yii/framework/logging/CFileLogRoute.php(55): CApplication->getRuntimePath()

#2 /var/www/vhosts/albern.to/subdomains/yii/httpdocs/yii/framework/logging/CLogRouter.php(65): CFileLogRoute->init()

#3 /var/www/vhosts/albern.to/subdomains/yii/httpdocs/yii/framework/base/CModule.php(357): CLogRouter->init()

#4 /var/www/vhosts/albern.to/subdomains/yii/httpdocs/yii/framework/base/CModule.php(445): CModule->getComponent('log')

#5 /var/www/vhosts/albern.to/subdomains/yii/httpdocs/yii/framework/base/CApplication.php(119): CModule->preloadComponents()

#6 /var/www/vhosts/albern.to/subdomains/yii/httpdocs/yii/framework/YiiBase.php(112): CApplication->__construct('/var/www/vhosts...')

#7 /var/www/vhosts/albern.to/subdomains/yii/httpdocs/yii/framework/YiiBase.php(85): YiiBase::createApplication('CWebApplication', '/var/www/vhosts...')

#8 /var/www/vhosts/albern.to/subdomains/yii/httpdocs/albern/index.php(11): YiiBase::createWebApplication('/var/www/vhosts...')

#9 {main}



Now I’ve installed this exact application on my other server and it ran fine, but then found it’s missing some GD support so it’s no good, not to mention it’s not meant for hosting other sites, just my own.

Here are the requirements that passed on my server:

http://www.sterlings…i/requirements/

And here they are for the server getting this error:

http://albern.to/yii...ments/index.php

The server is running Plesk 8.4

Here’s the real kicker, both the application folder and the yii folder holding the framework have chmod 755, and I’ve tried 777 but no dice, still get this error.

If I chmod protected/runtime, server will hang (if group gets write priviledges)

My web partner and I are trying two final tricks to see if we can get something going but maybe his SELinux server is just locked too tight. Our plans are to revise the extensions and where they are installed, I caught eye of a php4 folder mention in the php.ini and then the other is to give the folder the apache user rights to own the file. Aside from that we’re out of ideas.

Overall this has been a nice welcome back to the community, I can’t wait to be done with school and stuff and get back on projects for this.

Hopefully someone can shed light before I shoot myself in the head! haha

In the error the directory "protected/config/runtime" is mentioned, but later you mention "protected/runtime"?

sorry meant protected/config/runtime. Whether it’s chmod 755 or 777 doesn’t matter, still does nothing.

I did however find out as well that the server hangs from protected/runtime if it has group write permissions.

It’s just a slew of issues

If that works on one server and not on the other then that’s a server issue my friend not a framework issue. Best solution will be to either search for an answer regarding the server hang or use the framework with the server that does operate as normal.

I realize that, that’s why I gave the information about both platforms to see if anyone has had the issue before.

The problem with hosting it on the working server is 2 things. 1 it’s a small hosting setup, it’s meant for my business site, nothing more - we do some test here and there but I can’t run other companies off it specially when they plan on having lots of traffic and video uploads.

The other issue is I don’t have full control over the settings and the GD settings are not correct to run some of the code I’ve done in the framework, so that went out the door or else I would have hosted it temporary on my server.

Wouldn’t happen to know anything about centOS / plesk 8.4 and yii setups?

I found out why that actually happened too, in the basePath=> in the main config file, after the director seperator I had .’’ instead of the ‘…’ which skewed where it was pointing to. The error remains the same, it simply just removed the /config/ part in the link.

Solved!

I had the same problem and I fixed making the directory writable by the webserver (apache).

If you notice it says:


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.',

Solution:

To make it writable just execute:


# chown www-data -R <yii-directory> 


# chmod -R 777 /var/www/vhosts/albern.to/subdomains/yii/httpdocs/albern/protected/runtime

hi there,

just know yii for a hour now, and wanted to get my hands dirty, due i got the same error. I was playing around a bit and noticed the following:

i upload a fresh yii packages, copied onserver the demo blog files to the root and set the index.php and main.php.

the error was thrown.

i upload a fresh yii packages, ftp the demo blog files to the root and set the index.php and main.php.

no error, it worked.

it worked … thanks