Hello, maybe someone can help me with this problem I’m having;
When trying to use Yiic command line shell to create the model (model *) it outputs the following error:
exception ‘CDbException’ with message ‘CDbConnection failed to open the DB’
I can not figure out what’s happening, not only mysql pdo is there, I can do the following in my index.php:
$db = Yii::app()->db;
$command=$db->createCommand(‘select * from Alu’);
$rows = $command->queryAll();
print_r($rows[0]);
and it works just fine
Don’t know what to try
Something?
thanks
Juan
just in case, the output from requirements.php
PHP version Passed Yii Framework PHP 5.1.0 or higher is required.
$_SERVER variable Passed Yii Framework
Reflection extension Passed Yii Framework
PCRE extension Passed Yii Framework
SPL extension Passed Yii Framework
DOM extension Passed CWsdlGenerator
PDO extension Passed All DB-related classes
PDO SQLite extension Warning All DB-related classes This is required if you are using SQLite database.
PDO MySQL extension Passed All DB-related classes This is required if you are using MySQL database.
PDO PostgreSQL extension Warning All DB-related classes This is required if you are using PostgreSQL database.
Memcache extension Warning CMemCache
APC extension Warning CApcCache
Mcrypt extension Warning CSecurityManager This is required by encrypt and decrypt methods.
SOAP extension Warning CWebService, CWebServiceAction
GD extension Passed CCaptchaAction
sorry for the output, it’s a little kaos, but all is there
cyberpol
(Cyberpol 777)
3
sometimes (eg. in wamp instalations) the CLI PHP uses another php.ini file diferent to the php.ini used for the web.
Hope you understand!
A way to know if they are different is running phpinfo() both from a web browser and from command line
good idea, I’ll try that right now and let you know, thanks
excellent!! thanks a lot PoL, I’ll try to think a little more next time!
Juan