多个php版本,无法与mysqli连接

following http://kb.sp.parallels.com/en/118378 i succesfully installed php 5.4.38 and 5.5.21 to a centos 6.6 plesk server running on php 5.3

After transfering a joomla site on this server i get:

Error displaying the error page: Application Instantiation Error: Could not connect to MySQL.

By changing $dbtype from mysqli to mysql in joomla's configuration.php i got it working but this is not what i want

in addition i have more custom web sites that i transfered which use mysqli and all of them return:

Warning: mysqli_connect(): (HY000/2002): No such file or director

i checked unix_socket, it is the default but i saved it in the php.ini 's of php 5.4 and 5.5 anyways mysqli.default_socket = /var/lib/mysql/mysql.sockstill nothing

is it that php-mysqli is not istalled for the additional versions of php? if that is the case how can i yum install modules on these paraller php instances?

phpinfo for mysqli for default Centos 5.3.3 is

  • MysqlI Support enabled
  • Client API library version 5.1.73
  • Active Persistent Links 0
  • Inactive Persistent Links 0
  • Active Links 0
  • Client API header version 5.1.73
  • MYSQLI_SOCKET /var/lib/mysql/mysql.sock

phpinfo for mysqli for custom installed 5.4 is

  • MysqlI Support enabled
  • Client API library version mysqlnd 5.0.11-dev - 20120503 - $Id: bf************************8c5c77 $
  • Active Persistent Links 0
  • Inactive Persistent Links 0
  • Active Links 0

I have the same problem and I resolve changing "localhost" with 127.0.0.1