I'm currently learning the Yii framework, and one of the tutorials I was running through yesterday required me to test the database connection of a project.
The details aren't too important here, but basically when I run shell, and type in the command it throws up an error as follows:
server:trackstar charlieryan$ protected/yiic shell
Yii Interactive Tool v1.1 (based on Yii v1.1.13) Please type 'help' for help. Type 'exit' to quit.
echo Yii::app()->db->connectionString; PHP Warning: PDO::__construct(): [2002] No such file or directory (trying to connect via unix:///var/mysql/mysql.sock) in /Applications/MAMP/htdocs/trackstar/yii/framework/db/CDbConnection.php on line 423 exception 'CDbException' with message 'CDbConnection failed to open the DB connection: SQLSTATE[HY000] [2002] No such file or directory' in /Applications/MAMP/htdocs/trackstar/yii/framework/db/CDbConnection.php:381 Stack trace:
As far as I understand this is because Mac OS X's own version of PHP is being used which does not have support for a MySQL PDO Driver, but MAMP's own version does.
When I do the "which php" command, it returns "/usr/bin/php", which is the incorrect version. How do I change this to default to the MAMP version?