Please make sure it is a directory writable by the Web server process

When I transfered my application to the server this morning I get this error.

But I think everything is set up correctly



Le chemin d'accès « /home/www/ed3a58441fae69684a5a8204d2f03575/web/centre10/protected/runtime » du dossier d'exécution est invalide. Vérifiez que le proccessus du serveur web peut y accéder en écriture.

Fichier Source


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

00225:             return $this->_runtimePath;

00226:         }

00227:     }


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:     }


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:     }

Pile d'exécution

#0 /home/www/ed3a58441fae69684a5a8204d2f03575/web/yii/framework/base/CApplication.php(224): CApplication->setRuntimePath('/home/www/ed3a5...')

#1 /home/www/ed3a58441fae69684a5a8204d2f03575/web/yii/framework/logging/CFileLogRoute.php(55): CApplication->getRuntimePath()

#2 /home/www/ed3a58441fae69684a5a8204d2f03575/web/yii/framework/logging/CLogRouter.php(65): CFileLogRoute->init()

#3 /home/www/ed3a58441fae69684a5a8204d2f03575/web/yii/framework/base/CModule.php(363): CLogRouter->init()

#4 /home/www/ed3a58441fae69684a5a8204d2f03575/web/yii/framework/base/CModule.php(459): CModule->getComponent('log')

#5 /home/www/ed3a58441fae69684a5a8204d2f03575/web/yii/framework/base/CApplication.php(119): CModule->preloadComponents()

#6 /home/www/ed3a58441fae69684a5a8204d2f03575/web/yii/framework/YiiBase.php(112): CApplication->__construct('/home/www/ed3a5...')

#7 /home/www/ed3a58441fae69684a5a8204d2f03575/web/yii/framework/YiiBase.php(85): YiiBase::createApplication('CWebApplication', '/home/www/ed3a5...')

#8 /home/www/ed3a58441fae69684a5a8204d2f03575/web/centre10/index.php(13): YiiBase::createWebApplication('/home/www/ed3a5...')

#9 {main}

Please provide more info by pasting the return of the following command :

$ ls -l /home/www/ed3a58441fae69684a5a8204d2f03575/web/centre10/protected | grep runtime

Hi man, make sure the folder runtime and assets are writtable on the server.


runtime and assets are all writtable on the server.

Your server is saying that they aren’t writeable. You need to check again. :)


That says exactly that: your protected/runtime is INVALID. Verify the path and that is readable and writable.


Thx to all!

It’s ok know… the server had some problems

Hi fouss,

Can you please explain what was wrong with your server? Because I’m having the exact same problem and I already check de paths and that the folders are writeable…

thanks in advance!

Hi, i’m having the very same problem afte rmoving a project from my dev server to the live system.

I’ve read that it may be related to [font=“Arial Black”]SElinux[/font], an additional layer of security and rights enforcement on some linux distributions.

As i wont be able to mess with the server configs of a hosting company, the question which remains is, how to set up yii to be fine with SElinux, or if there are any solutions to this problem out there.

Hope some wise person answer our question.



found following solution, but this requires access/help on servers of hoster:

$ chcon -v --type=httpd_sys_script_rw_t /path to/protected/runtime

In order to make a directory writable by the webserver you have to set the directory’s owner or group to Apache’s owner or group and enable the write permission for it. Usually, we set the directory to belong to the Apache group (apache or www-data or whatever user is used to launch the child processes) and enable the write permission for the group.

chgrp apache /path/to/mydir

chmod g+w /path/to/mydir

Solution found @ blog. Worked for me.