I ran the initial set up and have modified the main.php to set up my connection string but am getting this error:
CException
Description
Property "CWebApplication.connectionString" is not defined.
Source File
/usr/local/lib/php/yii/yii-1.0.9.r1396/framework/base/CModule.php(431)
00419: }
00420: }
00421:
00422: /**
00423: * Configures the module with the specified configuration.
00424: * @param array the configuration array
00425: */
00426: public function configure($config)
00427: {
00428: if(is_array($config))
00429: {
00430: foreach($config as $key=>$value)
00431: $this->$key=$value;
00432: }
00433: }
00434:
00435: /**
00436: * Loads static application components.
00437: */
00438: protected function preloadComponents()
00439: {
00440: foreach($this->preload as $id)
00441: $this->getComponent($id);
00442: }
00443:
Stack Trace
#0 /usr/local/lib/php/yii/yii-1.0.9.r1396/framework/base/CModule.php(431): CComponent->__set(‘connectionStrin…’, ‘mysql:host=loca…’)
#1 /usr/local/lib/php/yii/yii-1.0.9.r1396/framework/base/CApplication.php(117): CModule->configure(Array)
#2 /usr/local/lib/php/yii/yii-1.0.9.r1396/framework/YiiBase.php(81): CApplication->__construct(’/home/site/pu…’)
#3 /home/site/public_html/app/index.php(11): YiiBase::createWebApplication(’/home/site/pu…’)
#4 {main}
What’s wierd is that I swear it was working before. I left if for a month and now am getting back to it and it is now throwing this error. The connection settings have not changed.
Here is my main.php:
<?php
// uncomment the following to define a path alias
// Yii::setPathOfAlias('local','path/to/local-folder');
// This is the main Web application configuration. Any writable
// CWebApplication properties can be configured here.
return array(
'connectionString'=>'mysql:host=localhost;dbname=subscriptions', 'username'=>'user', 'password'=>'pass',
'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
'name'=>'Subscriptions',
// preloading 'log' component
'preload'=>array('log'),
// autoloading model and component classes
'import'=>array(
'application.models.*',
'application.components.*',
),
// application components
'components'=>array(
'log'=>array(
'class'=>'CLogRouter',
'routes'=>array(
array(
'class'=>'CFileLogRoute',
'levels'=>'error, warning',
),
),
),
'user'=>array(
// enable cookie-based authentication
'allowAutoLogin'=>true,
),
// uncomment the following to set up database
'db'=>array(
'connectionString' => 'mysql:host=localhost;dbname=subscriptions',
'username' => 'user',
'password' => 'pass'
),
),
// application-level parameters that can be accessed
// using Yii::app()->params['paramName']
'params'=>array(
// this is used in contact page
'adminEmail'=>'webmaster@test.com',
),
);
Thanks for any help…