oceatoon
(Oceatoon)
February 22, 2012, 5:12pm
1
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
Y11
(Y!!)
February 22, 2012, 6:11pm
2
[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.
oceatoon
(Oceatoon)
February 22, 2012, 6:29pm
3
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?
Y11
(Y!!)
February 22, 2012, 6:36pm
4
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.
oceatoon
(Oceatoon)
February 22, 2012, 6:55pm
5
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