We have recently deployed the above LAMP stack to AWS
We found some contradictions/conflicts in base stack configuration relative to PHP and MySQL.
Specifically the following:
As you can see, MySQL believes that mysql.socket is in /tmp path (absolute)
Where as PHP sees mysql.socket in /opt/bitnami/mysql/tmp (absolute path, which is correct)
How can we fix this? (/opt/bitnami/mysql/my.cnf is showing the bitnami path correctly, but in PHP info showing something different)
The first one is the default location and you can overwrite with an environment variable. The MySQL socket location is in "/opt/bitnami/mysql/tmp/mysql.sock". Could you post the exact error that PHP reported?
Thanks for the reply.
The error we are getting is:
Error : SQLSTATE[HY000]  Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) Error Number : 2002
Date : Oct 09 2011 23:01:22
Script : /
IP Address : 126.96.36.199
The my.cnf is not using the above path, so the above path shown in error is being set somewhere else.
Usually you can configure the MySQL socket location in the application itself. As a workaround you can create a symlink to the default location:
$ sudo ln -s /opt/bitnami/mysql/tmp/mysql.sock /tmp/mysql.sock