running the yiic tool for creating CRUD operations fails to connect to my database. When issue>> model User,
the error message is: 'DbConnection failed to open the DB connection: could not find driver'
I have a working MAMP installation with PDO enabled (when checking PHP info). The only change I've made to the application after running "yiic webapp" is in the config.php and the db section:
It's because your CLI PHP is using a different php.ini that does not enable the needed PDO driver. You may use the following command to start yiic shell instead to ensure it uses the right php.ini:
I’ve checked localization of php.ini file with phpinfo(), and it is set to C:\Documents and Settings\Ricardo\Local Settings\Temp\Server2Go_3776\php.ini
Now I have command:
C:\server2go\htdocs\blog>php -c "C:\Documents and Settings\Ricardo\Local Settings\Temp\Server2Go_3776\php.ini" protected\yiic.php shell index.php
and it works, but maybe someone will know how to change it to another php.ini ?
C:\server2go\htdocs\blog\index.php - my blog aplication index
C:\server2go\server\config_tpl\php.ini - my php.ini file