As a great advocate of Prado, it's great to see Yii is the new generation! Looks great, but I'm having some problems getting the first app to run.
I'm using the tutorial in the help documentation and am at the point "Implementing CRUD Operations" When I run the yiic shell command, I receive the following error… something to do with session permissions:
As the error says, you don't have permission to write in /var/lib/php/session.
You may need to check what php.ini is being used by your php command line program (it could be different from the online one). Also make sure the session temp directory is writable.
Thanks Qianq, it got me past the first step. I had to run it under different permissions. yiic shell runs fine and I get teh >> prompt.
But, when I type model User<enter>, I get
exception 'CDbException' with message 'CDbConnection failed to open the DB connection: could not find driver' in /var/www/html/dev/yii/framework/db/CDbConnection.php:226
Stack trace:
#0 /var/www/html/dev/yii/framework/db/CDbConnection.php(201): CDbConnection->open()
#1 /var/www/html/dev/yii/framework/db/CDbConnection.php(180): CDbConnection->setActive(true)
#2 /var/www/html/dev/yii/framework/core/CApplication.php(710): CDbConnection->init()
#3 /var/www/html/dev/yii/framework/core/CApplication.php(361): CApplication->getComponent('db')
#4 /var/www/html/dev/yii/framework/cli/commands/shell/ModelCommand.php(92): CApplication->getDb()
#5 [internal function]: ModelCommand->generateModel('/var/www/html/d...', Array)
#6 /var/www/html/dev/yii/framework/console/CConsoleCommand.php(116): call_user_func(Array, '/var/www/html/d...', Array)
#7 /var/www/html/dev/yii/framework/cli/commands/shell/ModelCommand.php(72): CConsoleCommand->copyFiles(Array)
#8 /var/www/html/dev/yii/framework/cli/commands/ShellCommand.php(95): ModelCommand->run(Array)
#9 /var/www/html/dev/yii/framework/cli/commands/ShellCommand.php(75): ShellCommand->runShell()
#10 /var/www/html/dev/yii/framework/console/CConsoleCommandRunner.php(62): ShellCommand->run(Array)
#11 /var/www/html/dev/yii/framework/console/CConsoleApplication.php(88): CConsoleCommandRunner->run(Array)
#12 /var/www/html/dev/yii/framework/core/CApplication.php(146): CConsoleApplication->processRequest()
#13 /var/www/html/dev/yii/framework/yiic.php(30): CApplication->run()
#14 /var/www/html/dev/yii/framework/yiic(15): require_once('/var/www/html/d...')
#15 {main}
This type of error is mentioned in the manual regarding using the incorrect PHP CLI or php.ini file. I'm not sure how to use the "correct" php cli, since I believe there is only one. As far as the php.ini file, i ran it with the -n switch(no ini) and the -c(specified the php.ini in the live environment). In either case, I receive the same error.
My pdo.so and pdo_mysql.so are in the extension_dir referenced by php.ini. When I run phpinfo(), they are there and enabled. The pdo_mysql version is 5.0.45.
I'd rather continue posting in this topic than start a new one as I'm basically having the same problem as outlined in post #1
I've tried running the script with the php cli (php -c /path/to/php.ini etc…) and it made no difference.
Now the only thing I can think of is the fact that all session files in /var/lib/php/session/ belong to apache:apache as opposed to [user]:[group] in the website I'm trying to get yii to work. However I'm not sure how to modify my php.ini to make that work…
For info I run php 5.1.6 and all sub-sites point to the same php.ini file.
So if anyone has ideas what to do to get the yii shell to run that'd be appreciated.
When I originally had this problem, it was because I was logged in as a user with restricted permissions. When I logged in as admin, since it was a dev machine, it worked fine.
Right I changed the permissions in my /sessions folder and that got me through the first hurdle of connecting to the shell, however I’m now having troubles connecting to the database, a similar problem to this thread -> http://www.yiiframew…php?topic=407.0
unfortunately, the solutions presented there don't work for me. if that helps running SHOW COLUMNS FROM User displays the following: