Skip to content
Snippets Groups Projects
Commit cd184549 authored by Webslice's avatar Webslice
Browse files

Use 127.0.0.1 as APS db host if php_fpm_chroot, fixes #5235

parent 3fa01645
No related branches found
No related tags found
No related merge requests found
......@@ -249,6 +249,15 @@ class ApsGUIController extends ApsBase
$settings['main_database_host'] = 'localhost';
$mysql_db_remote_access = 'n';
$mysql_db_remote_ips = '';
// If we are dealing with chrooted PHP-FPM, use a network connection instead because the MySQL socket file
// does not exist within the chroot.
$php_fpm_chroot = $app->db->queryOneRecord("SELECT php_fpm_chroot FROM web_domain WHERE domain_id = ?", $websrv['domain_id']);
if ($php_fpm_chroot['php_fpm_chroot'] === 'y') {
$settings['main_database_host'] = '127.0.0.1';
$mysql_db_remote_access = 'y';
$mysql_db_remote_ips = '127.0.0.1';
}
} else {
//* get the default database server of the client
$client = $app->db->queryOneRecord("SELECT default_dbserver FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = ?", $websrv['sys_groupid']);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment