catfan / Medoo

The lightweight PHP database framework to accelerate the development.
https://medoo.in
MIT License
4.83k stars 1.15k forks source link

AH01071: Got error PHP message: PHP Warning: Undefined array key "server" #964

Closed rvalitov closed 3 years ago

rvalitov commented 3 years ago

Describe the bug I get a warning message in the error.log:

AH01071: Got error 'PHP message: PHP Warning:  Undefined array key "server" in /vendor/catfan/medoo/src/Medoo.php on line 216

Information

Detail Code I use a socket connection

new Medoo([
            // [required]
            'type' => 'mysql',
            'socket' => '/var/run/mysqld/mysqld.sock',
            'database' => 'c1hbm',
            'username' => 'c1hbm',
            'password' => 'xxxx',

            // [optional]
            'charset' => 'utf8mb4',
            'collation' => 'utf8mb4_general_ci',

            // [optional] Enable logging, it is disabled by default for better performance.
            'logging' => true,

            // [optional]
            // Error mode
            // Error handling strategies when error is occurred.
            // PDO::ERRMODE_SILENT (default) | PDO::ERRMODE_WARNING | PDO::ERRMODE_EXCEPTION
            // Read more from https://www.php.net/manual/en/pdo.error-handling.php.
            'error' => PDO::ERRMODE_SILENT,
        ]);
catfan commented 3 years ago

Thanks for the feedback. It's fixed on 00745b4.