title: PHP MYSQL - Difference between 127.0.0.1 and localhost
body: <p>I am encountering a strange problem on my imac running OS X. For my frameworks and CMS configuration files if I use host: localhost (in db settings) an error is produced and the CMS/framework cannot connect to the database. However if I replace localhost to 127.0.0.1 everything seems to work fine. Since localhost is resolved to 127.0.0.1 I'd like to know what might be the problem with my php/mysql configurations that is resulting into this behavior.?
  I encountered this problem with Wordpress, Cake and CodeIgniter.</p>