Welcome Guest. Please Login or Register  


You are here: Index > Softaculous Auto Installer > General Support > Topic : Error establishing a database connection using Php fpm chroot in ISPConfig via Softaculous



Threaded Mode | Print  

 Error establishing a database connection using Php fpm chroot in ISPConfig via Softaculous (6 Replies, Read 4388 times)
EuroDomenii
Group: Member
Post Group: Newbie
Posts: 15
Status:
Softaculous generates wp-config.php with localhost:3306, which causes PHP to attempt a connection to a unix socket rather than over TCP/IP. The unix socket file does not exist in the chroot, so the database connection fails.

A similar issue is in “APS installer in chrooted PHP-FPM: database connection problems” https://git.ispconfig.org/ispconfig/ispconfig3/issues/5235, fixed with  https://git.ispconfig.org/ispconfig/ispconfig3/-/merge_requests/879/diffs . Since Softaculous php files are encrypted, I can’t hack in.

Trying to change $conf['db_host'] = '127.0.0.1'; in /usr/local/ispconfig/server/lib/config.inc.php
And /usr/local/ispconfig/interface/lib/config.inc.php doesn’t help either.

BTW, when creating the website, where does softaculous gets his information about the database? From mysql_clientdb_plugin.inc.php? Maybe we could also hack some ispconfig plugins.

A related issue is https://www.softaculous.com/board/index.php?tid=16135&title=ispconfig “Yes you can use an external MySQL server. You need to set that server as default MySQL server and then Softaculous will create databases on the remote server.”  The difference is that I have to trigger 127.0.0.1, instead of localhost, for default local server.

Using [client] protocol=tcp in my.cnf won’t help ( via https://serverfault.com/questions/337818/how-to-force-mysql-to-connect-by-tcp-instead-of-a-unix-socket)

Thanks!
IP: --   

Error establishing a database connection using Php fpm chroot in ISPConfig via Softaculous
Brijesh
Group: Softaculous Team
Post Group: Super Member
Posts: 5640
Status:
Hi,

You can define the database host in universal.php as :
$ispconfig['dbhost'] = '127.0.0.1';

-----------------------
Webuzo - Multi User Hosting Control Panel
AMPPS - Best WordPress/PHP/MySQL development tool
IP: --   

Error establishing a database connection using Php fpm chroot in ISPConfig via Softaculous
EuroDomenii
Group: Member
Post Group: Newbie
Posts: 15
Status:
Quote From : Brijesh April 24, 2020, 7:37 am
Hi,

You can define the database host in universal.php as :
$ispconfig['dbhost'] = '127.0.0.1';


Thanks, it works!  Previouslly, I was looking at Softaculous Settings, now I  know about https://www.softaculous.com/docs/developers/custom-integration/#understanding-universal-php, but it was counter intuitive for me, as an end user.

Could yout document this in https://www.softaculous.com/docs/admin/installing-softaculous-in-ispconfig/#common-issue ?
IP: --   

Error establishing a database connection using Php fpm chroot in ISPConfig via Softaculous
Brijesh
Group: Softaculous Team
Post Group: Super Member
Posts: 5640
Status:
Hi,

We have made changes in Softaculous to detect and handle php_fpm_chroot so that you do not need to set the dbhost variable in universal.php

I have emailed you the patch.

Please test the patch and let us know, we plan to include this fix in the next version of Softaculous.

-----------------------
Webuzo - Multi User Hosting Control Panel
AMPPS - Best WordPress/PHP/MySQL development tool
IP: --   

Error establishing a database connection using Php fpm chroot in ISPConfig via Softaculous
bhavana
Group: Member
Post Group: Newbie
Posts: 10
Status:
Hi,

We have released new version of Softaculous 5.4.9 which includes the fix.

Please upgrade to the latest version of Softaculous by executing the CRON command as given in the guide below:
http://www.softaculous.com/docs/admin/immediate-synchronize-with-softaculous-servers/
IP: --   

Error establishing a database connection using Php fpm chroot in ISPConfig via Softaculous
EuroDomenii
Group: Member
Post Group: Newbie
Posts: 15
Status:
Thanks for including this feature in the new release!

Tests after upgrading to 5.4.9:

New installation without Chroot PHP-FPM works ok with localhost[li][/li]

New installation with Chroot PHP-FPM triggers /** MySQL hostname */ define( 'DB_HOST', '127.0.0.1' );

One limitation: Switching on/off Chroot PHP-FPM option should update accordingly wp-config.php and Database host of existing installations.  I guess this is harder to implement and it should be low priority. Once a user decides to use Chroot PHP-FPM  from the beginning, it should stick to it.

For new installations Switching on/off Chroot PHP-FPM works as designed
IP: --   

Error establishing a database connection using Php fpm chroot in ISPConfig via Softaculous
Brijesh
Group: Softaculous Team
Post Group: Super Member
Posts: 5640
Status:
Hi,

Glad to know it works fine now.

However regarding updating the database host for all existing installations will not be possible.

-----------------------
Webuzo - Multi User Hosting Control Panel
AMPPS - Best WordPress/PHP/MySQL development tool
IP: --   

« Previous    Next »

Threaded Mode | Print  



Jump To :


Users viewing this topic
1 guests, 0 users.


All times are GMT. The time now is March 28, 2024, 6:14 pm.

  Powered By AEF 1.0.8 © 2007-2008 Electron Inc.Queries: 11  |  Page Created In:0.023