0

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?!

Thx!

Spacey
  • 3
  • 1

1 Answers1

0

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 127.0.0.1 and see if it works any better.

William Sandin
  • 743
  • 5
  • 9
  • 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 06 '19 at 09:33