We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I discovered that this file:
admin/plugins/restapi/includes/pdo.php
does not check the server port specified in the config file.
My quick fix was:
--- pdo.php.old 2024-01-05 18:38:56.724455609 +0100 +++ pdo.php 2024-01-05 18:07:00.221162380 +0100 @@ -15,7 +15,8 @@ $dbuser = $GLOBALS['database_user']; $dbpass = $GLOBALS['database_password']; $dbname = $GLOBALS['database_name']; - $dbh = new \PDO("mysql:host=$dbhost;dbname=$dbname;charset=UTF8;", $dbuser, $dbpass, array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES 'utf8';")); + $dbport = $GLOBALS['database_port']; + $dbh = new \PDO("mysql:host=$dbhost;dbname=$dbname;port=$dbport;charset=UTF8;", $dbuser, $dbpass, array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES 'utf8';")); $dbh->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION); return $dbh;
It also doesn't appear to use a socket either even if specified in the config file eg this format:
$dsn = 'mysql:dbname=testdb;unix_socket=/path/to/socket';
The text was updated successfully, but these errors were encountered:
Thanks, would you be able to turn that into a Pull Request, so we can process it?
Sorry, something went wrong.
Yup I can give it a go!
I'll try and add the socket option if that is detected in the config.
Fix missing DB port and socket
8c556c4
phpList#73
No branches or pull requests
I discovered that this file:
admin/plugins/restapi/includes/pdo.php
does not check the server port specified in the config file.
My quick fix was:
It also doesn't appear to use a socket either even if specified in the config file eg this format:
The text was updated successfully, but these errors were encountered: