Hi,
I posted this in the wrong section a few days ago, so I’m re-posting here in the hopes that someone can help.
I’m trying to create the scaffolding as described on page 8 of the Yii Blog tutorial (1.0.7), but whenever I model a table I get:
[color="#0000FF"]>> model Post
Warning: the table ‘Post’ does not exist in the database.
unchanged Post.php
The following model classes are successfully generated:
Post
If you have a ‘db’ database connection, you can test these models now with:
$model=Post::model()->find();
print_r($model);[/color]
I was having a problem even creating the table prior to this:
[color="#0000FF"]>> model User
exception ‘CDbException’ with message ‘CDbConnection failed to open the DB connection: SQLSTATE[HY000] [14] unable to open database file’ in /Library/WebServer/Documents/yii_test/framework/db/CDbConnection.php:248
Stack trace:
#0 /Library/WebServer/Documents/yii_test/framework/db/CDbConnection.php(223): CDbConnection->open()
#1 /Library/WebServer/Documents/yii_test/framework/db/CDbConnection.php(202): CDbConnection->setActive(true)
#2 /Library/WebServer/Documents/yii_test/framework/base/CModule.php(353): CDbConnection->init()
#3 /Library/WebServer/Documents/yii_test/framework/base/CApplication.php(338): CModule->getComponent(‘db’)
#4 /Library/WebServer/Documents/yii_test/framework/cli/commands/shell/ModelCommand.php(267): CApplication->getDb()
#5 /Library/WebServer/Documents/yii_test/framework/cli/commands/ShellCommand.php(142): ModelCommand->run(Array)
#6 /Library/WebServer/Documents/yii_test/framework/cli/commands/ShellCommand.php(99): ShellCommand->runShell()
#7 /Library/WebServer/Documents/yii_test/framework/console/CConsoleCommandRunner.php(62): ShellCommand->run(Array)
#8 /Library/WebServer/Documents/yii_test/framework/console/CConsoleApplication.php(88): CConsoleCommandRunner->run(Array)
#9 /Library/WebServer/Documents/yii_test/framework/base/CApplication.php(133): CConsoleApplication->processRequest()
#10 /Library/WebServer/Documents/yii_test/framework/yiic.php(31): CApplication->run()
#11 /Library/WebServer/Documents/yii_test/framework/yiic(15): require_once(’/Library/WebSer…’)
#12 {main}[/color]
but after using an SQLite tool (SQLite Database Browser) to create the table the initial error went away and now I’m stuck at this point.
I’ve run php_info from the cli and it reports that my php ini file is where it should be (and there’s only one ini file being returned in any case).
[color="#FF8C00"]Configuration File (php.ini) Path => /usr/local/php5/lib
Loaded Configuration File => /usr/local/php5/lib/php.ini
Scan this dir for additional .ini files => /usr/local/php5/php.d[/color]
I’m running PHP 5.2.2 on Apache 1.3.4 on Mac OS X 10.4.11
any help would be great,
thanks
*reece