You need to change the location of the mysql socket in php.ini:
pdo_mysql.default_socket=/opt/local/var/run/mysql55/mysqld.sock
You can see the real path to the socket this way:
$ mysql -u root -p
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.5.36 Source distribution
Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> show variables like '%socket%';
+---------------+----------------------------------------+
| Variable_name | Value |
+---------------+----------------------------------------+
| socket | /opt/local/var/run/mysql55/mysqld.sock |
+---------------+----------------------------------------+
1 row in set (0.04 sec)