Production Environment Issue


I created a basic site that allow authenticated users to upload files onto the database. It works perfectly on my local wamp environment but when I uploaded the files to production ( I get the following error mesg. Does anyone know why this occurs? Is there a setting I am missing?




The table "Report" for active record class "Report" cannot be found in the database.

Source File


02142: private $_validators;


02144: /**

02145: * Constructor.

02146: * @param CActiveRecord the model instance

02147: */

02148: public function __construct($model)

02149: {

02150: $this->_model=$model;


02152: $tableName=$model->tableName();

02153: if(($table=$model->getDbConnection()->getSchema()->getTable($tableName))===null)

02154: throw new CDbException(Yii::t(‘yii’,‘The table “{table}” for active record class “{class}” cannot be found in the database.’,

02155: array(’{class}’=>get_class($model),’{table}’=>$tableName)));

02156: if($table->primaryKey===null)

02157: $table->primaryKey=$model->primaryKey();

02158: $this->tableSchema=$table;

02159: $this->columns=$table->columns;


02161: foreach($table->columns as $name=>$column)

02162: {

02163: if(!$column->isPrimaryKey && $column->defaultValue!==null)

02164: $this->attributeDefaults[$name]=$column->defaultValue;

02165: }


Have you updated main.php to reflect the db environment on your host as opposed to your local dev environment, and with the right credentials?

Also, did you create those databases and tables on the host?

The database and tables have been created.

I was also successful in using basic php/mysql (not using yii) to retrieve data from the table.

I wonder if it might be an issues with the php.ini settings. My local environment has these settings:














































but when I try to configure the production php.ini I see the following mesg:

;Windows Extensions

;Note that MySQL and ODBC support is now built in, so no dll is needed for it.

What about the Yii DB config in protected/config/main.php?

Is the ‘Report’ table the only one you have at the moment? If not, can your app access other tables?

It looks like Yii can’t access the database and thus can’t find the table, so checking main.php to see if the database config is correct is worth checking out :)

The php.ini is probably ok or Yii would throw different exceptions, I believe, so everything is working as it should until it tries to access the table.

main.php was actually the first place I checked, all the info should be in order unless I have a syntax error







then using the same credentials I created a test page to access the database and table. There’s only one table in the database so, I’m not sure if it’s only have trouble with that one table or just the database in general. You have a good point. I’ll try to add another table to see if that one is accessible.


Another clue might be case sensitivity. Is the "Report" table with a capital "r"?

I didn’t realize the table names were case-sensitive. The table name is currently lower case. Does it need to be upper case?


Just want to send out an update.

After updating the table name to start with uppercase, I am now able to connect. Oddly enough, all this time that I was developing locally, my table name was entirely lowercase but worked fine.

Anyhow, thank you all for your help!

Is your development environment Windows? IIRC, case sensitivity of table (and some other) names works differently under Windows and Linux. IIRC, this is an attempt to deal with a more general case sensitivity brokenness under Windows.

I just got the same problem! thank you for your question same as mine.

I notice that in my case, the mysql engine for each table was changed to myisam instead of innodb. I read the mysql manual and it says something like innodb is case-insensitive. I tried to change, in production system, from innodb to myisam but no success. I don’t know why. Finally, I just change the table name to what ever the error code says and it works.

thanks very much