// change the following paths if necessary $yii = $curr . '/yii/framework/yii.php'; $config = $curr . '/protected/config/production.php'; // specify how many levels of call stack should be shown in each log message defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL', 3); } else { $config = $curr . '/protected/config/main.php'; // remove the following lines when in production mode defined('YII_DEBUG') or define('YII_DEBUG', true); // specify how many levels of call stack should be shown in each log message defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL', 3); } require_once $yii; Yii::createWebApplication($config); /** * SET WITH YOUR VALUE ------------------------ * decide your own PATH here * for description then you need to read kcfinder manual */ $uploadURL = Yii::app()->baseUrl . '/..' . Yii::app()->params['fileDownloadPath']; $uploadDir = dirname(__FILE__) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . Yii::app()->params['fileDownloadPath']; $session = new CHttpSession(); $session->setSavePath(Yii::app()->session->savePath); $session->open(); $session['KCFINDER'] = array(); $session['KCFINDER'] = array('disabled' => !UserIdentity::canBrowseServer(), 'uploadURL' => $uploadURL, 'uploadDir' => $uploadDir); // then back to our path chdir($current_cwd); spl_autoload_unregister(array('YiiBase', 'autoload')); spl_autoload_register('__autoload'); spl_autoload_register(array('YiiBase', 'autoload'));