Проблема с директорией

Здравствуйте. Помогите, пожалуйста, новичку.

Я использую Fedora 15, PHP 5.1.0 or higher, 5.5.14 MySQL Community Server, последнюю версию YII.

Когда прохожу первый урок

/doc/guide/1.1/en/quickstart.first-app

а именно после распаковки testdriv-a

и перехода по ссылке

hostname/testdrive/index.php

получаю следующее сообщение

CException

Application runtime path "/var/www/html/testdrive/protected/runtime" is not valid. Please make sure it is a directory writable by the Web server process.

/var/www/html/yii-1.1.8.r3324/framework/base/CApplication.php(267)

255 return $this->_runtimePath;

256 }

257 }

258

259 /**

260 * Sets the directory that stores runtime files.

261 * @param string $path the directory that stores runtime files.

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

263 */

264 public function setRuntimePath($path)

265 {

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

267 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.’,

268 array(’{path}’=>$path)));

269 $this->_runtimePath=$runtimePath;

270 }

271

272 /**

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

274 * @return string the directory that contains all extensions. Defaults to the ‘extensions’ directory under ‘protected’.

275 */

276 public function getExtensionPath()

277 {

278 return Yii::getPathOfAlias(‘ext’);

279 }

Stack Trace

#0

  • /var/www/html/yii-1.1.8.r3324/framework/base/CApplication.php(254): CApplication->setRuntimePath("/var/www/html/testdrive/protected/runtime")

#1

  • /var/www/html/yii-1.1.8.r3324/framework/logging/CFileLogRoute.php(55): CApplication->getRuntimePath()

#2

  • /var/www/html/yii-1.1.8.r3324/framework/logging/CLogRouter.php(65): CFileLogRoute->init()

#3

  • /var/www/html/yii-1.1.8.r3324/framework/base/CModule.php(372): CLogRouter->init()

#4

  • /var/www/html/yii-1.1.8.r3324/framework/base/CModule.php(477): CModule->getComponent("log")

#5

  • /var/www/html/yii-1.1.8.r3324/framework/base/CApplication.php(142): CModule->preloadComponents()

#6

  • /var/www/html/yii-1.1.8.r3324/framework/YiiBase.php(128): CApplication->__construct("/var/www/html/testdrive/protected/config/main.php")

#7

  • /var/www/html/yii-1.1.8.r3324/framework/YiiBase.php(100): YiiBase::createApplication("CWebApplication", "/var/www/html/testdrive/protected/config/main.php")

#8

– /var/www/html/testdrive/index.php(13): YiiBase::createWebApplication("/var/www/html/testdrive/protected/config/main.php")

08 defined(‘YII_DEBUG’) or define(‘YII_DEBUG’,true);

09 // specify how many levels of call stack should be shown in each log message

10 defined(‘YII_TRACE_LEVEL’) or define(‘YII_TRACE_LEVEL’,3);

11

12 require_once($yii);

13 Yii::createWebApplication($config)->run();

2011-08-20 01:19:12 Apache/2.2.19 (Fedora) Yii Framework/1.1.8

Пробовал менять права доступа и владельца директории /var/www/html/testdrive/protected/runtime, но результат тот же.

Заранее благодарен.

Влад.

[color=#333333][font=arial, sans-serif][size=2]Вы вставьте основной конфигурационный файл,

который находится под защитой / [/size][/font][/color][color=#333333][font=arial, sans-serif][size=2]config.php[/size][/font][/color]

[font="arial, sans-serif"][size="3"][color="#333333"]

[/color][/size][/font]

[color=#333333][font=arial, sans-serif][size=2]

would you paste your main configuration file,

which is under protected/config.php[/size][/font][/color]

Ok. Thank you a lot.

I find how to solve this problem.

It is problem with Linux SElinux. The way to solve follow.

Temporarily turn it off is.

echo 0 >/selinux/enforce

The next problem is with date. I got follow message “date(): It is not safe to rely on the system’s timezone settings. You are required to use the date.timezone setting or the date_default_timezone_set() function.”.

The way to solve it - put this in your index.php:

date_default_timezone_set(‘America/New_York’);