I created an debian 9 machine with ISPConfig - standard stuff (after this tut: https://www.howtoforge.com/tutorial/perfect-server-debian-9-stretch-apache-bind-dovecot-ispconfig-3-1/ ). Comes with PHP 7 out of the box... I added PHP 5.6 (after this: https://www.howtoforge.com/tutorial/how-to-install-php-7-on-debian/ ) and in general it works. But when trying to connect to a mysql (Maria) db the error log shows:

[Fri Jan 04 22:05:13.725538 2019] [proxy_fcgi:error] [pid 3617] [client xx.xx.xx.5:61335] AH01071: Got error 'PHP message: PHP Warning: mysqli_real_connect(): (HY000/2002): No such file or directory in /var/www/clients/client1/web2/web/lib/adodb/drivers/adodb-mysqli.inc.php on line 109\n', referer: http://gallery2.my-website.de/install/index.php?step=5

I tried to run PHP 5.6 as fast-cgi or php-fpm - same result. Switching to PHP 7 then it works - same adodb driver file as shown in the log! So I guess it has something to do with missing stuff within PHP 5.6.

And ideas where to look?!


  • What's on line 109 of that file? – Rick James Jan 4 '19 at 23:25
  • Have you installed php5-mysql ? – Orphans Jan 5 '19 at 9:51
  • php5-mysql is compiled in and the line 109 I checked as well but that one works very well with php7 so can't be some "broken code" at that place. The line shows " $this->clientFlags);" – Spacey Jan 6 '19 at 9:35

If you use localhost as a target database host it will try connect using MySQL socket, mysql.sock rather than a TCP connection, which likely is to be your problem. Try and see if it works any better.

  • That solved the problem.... but I'm curious why "localhost" works with php7 and not with php5. Anyway unfortunately some more problems with the old gallery2 code in the error log. Thx! – Spacey Jan 6 '19 at 9:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.