db config work for main cofnig but not for console

Hi

I have a starnge behavior where

my db configuration work perfectly for main config

as my application is running fine

but I wanted to try fiddling with migrate

and set up the same configs as in main

but I keep getting an Exception

exception ‘CDbException’ with message ‘CDbConnection failed to open the DB connection: could not find driver’

I don’t really know where to go from here, did all the checks in different use cases from the forum

creating migrations works fine

it’s break when creating a table

[color="#808080"]Moved from Job Opportunities[/color]

Looks like the php-cli uses a different php.ini. Try dumping phpinfo() from the console and check whether the database driver is enabled.

yep that confirms it but how is the context change between the browsers use of php.exe client and the console

do you know how I can force that to the same as the one interpreted in the browser?

Simply tell you hosting provider that you need the XXX pdo driver in cli context. Or if you manage your own server, recompile php accordingly. There is no other option.

Thanks

here’s a solution that worked for me

thanks to your path :)

compare a phpinfo dump from browser and from console

if there is a difference in context and loaded php.ini

Then you can force like this

copy the path from the browsers info

and force that one to be used on the php client

php -c "proper/path/to/your/apache/php.ini" yiic migrate

Cheers and thanks for your time , it was precious