After getting this beautiful error:
Warning: PDO::__construct():  No such file or directory (trying to connect via unix:///var/mysql/mysql.sock) in /some/path/here/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Connection.php on line 470
PDO Connection Error: SQLSTATE[HY000]  No such file or directory
Some solutions says that first you need to find the php.ini (that’s like looking for the Holy Grail or something similar!). So, the best way is to «join to your enemies» by creating a link to the current folder where the mysql.sock is created through:
cd /var;sudo ln -s /Applications/MAMP/tmp/mysql mysql
(Taken from Stackoverflow)
Particularly, I used MAMP.