• Debian 11 is approaching its end-of-life (vendor EOL date - August 31, 2026). Plesk Obsidian 18.0.80 will be the last release to support it.
    If you are running Plesk Obsidian on Debian 11, we recommend you upgrade those servers to Debian 12 using our dist-upgrade tool.
  • We plan to deprecate and remove the support for XML RPC protocol versions earlier than 1.6.9.1 in Plesk Obsidian 18.0.82. We strongly recommend that you update all existing integrations using earlier versions of the XML RPC protocol to comply with the version 1.6.9.1 specification.

Issue MySQL php_network_getaddresses: getaddrinfo failed: Name or service not known

JohnWorks

New Pleskian
Hello community,

I have a problem connecting to my database. Remote Access is enabled (Go to Tools & Settings > Database Servers > Settings > click Local MySQL Settings: Select the Allow local MySQL server to accept external connections checkbox, and then click OK Link).

Database name, user and password are correct. Hostname is: localhost:3306

PHP: 7.4.30 FPM-Anwendung (Apache) mysqli is enabled

The data is in a subdomain, which is registered as a separate application.

PHP:
    private $servername = "localhost:3306";
    private $username = "user";
    private $password = "pw";
    private $dbname = "dbname";

    private $conn;

    function __construct() {

        $this->conn = new mysqli($this->servername, $this->username, $this->password, $this->dbname);

        if ($this->conn->connect_error) {

            die("Connection failed: " . $this->conn->connect_error);

        }

        $this->conn->set_charset("utf8");

    }

Displayed error in the browser:
Code:
Connection failed: php_network_getaddresses: getaddrinfo failed: Name or service not known

Displayed error in the log:
Code:
AH01071: Got error 'PHP message: PHP Warning: mysqli::__construct(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /var/www/vhosts/domain/subdomain.domain.de/db.php on line 30PHP message: PHP Warning: mysqli::__construct(): (HY000/2002): php_network_getaddresses: getaddrinfo failed: Name or service not known in /var/www/vhosts/domain/subdomain.domain.de/db.php on line 30', referer: https://subdomain.domain.de/login.php

Plesk Obsidian 18.0.45 (Ubuntu) on IONOS
 
Back
Top