Skip to content
New issue

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

php_pdo_mysql extension must be enabled for PDOConnector to work #8103

Closed
kinglozzer opened this issue May 29, 2018 · 1 comment
Closed

php_pdo_mysql extension must be enabled for PDOConnector to work #8103

kinglozzer opened this issue May 29, 2018 · 1 comment

Comments

@kinglozzer
Copy link
Member

kinglozzer commented May 29, 2018

In order to use PDOConnector you must enable the php_pdo_mysql extension - even if you’re not using a MySQL database:

$options = array(
PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES ' . $charset . ' COLLATE ' . $connCollation
);

If the extension isn’t enabled, PDO::MYSQL_ATTR_INIT_COMMAND isn’t defined.

Simplest fix is probably to wrap that in an if (defined('PDO::MYSQL_ATTR_INIT_COMMAND')), but a much nicer fix would be to implement @tractorcow’s suggestion here: tractorcow#18

@tractorcow
Copy link
Contributor

Ah right, yes I think we should do that too. Quick fix is the defined() conditional though.

dhensby added a commit that referenced this issue Jun 8, 2018
FIX: Only set MYSQL_ATTR_INIT_COMMAND when using mysql driver (fixes #8103)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants