Symfony and Mac

After getting this beautiful error:

Warning: PDO::__construct(): [2002] 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] [2002] 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.

Esta entrada fue publicada en Symfony y etiquetada , . Guarda el enlace permanente.

Deja un comentario

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *