Skip to content

[12.x] Fix| Fallback to PDO::const when Mysql::const not available#60274

Closed
YasserB94 wants to merge 3 commits into
laravel:12.xfrom
YasserB94:fix/12.x-pdo-mysql-missing-constant
Closed

[12.x] Fix| Fallback to PDO::const when Mysql::const not available#60274
YasserB94 wants to merge 3 commits into
laravel:12.xfrom
YasserB94:fix/12.x-pdo-mysql-missing-constant

Conversation

@YasserB94
Copy link
Copy Markdown

@YasserB94 YasserB94 commented May 26, 2026

Issue

Laravel Framework 12.x references the php 8.4 Mysql::ATTR_SSL_VERIFY_SERVER_CERT const.
Yet, since symfony/polyfill-php84:v1.38.0 it is no longer available (bug #590 PHP can be built without PDO::MYSQL_ATTR_SSL_VERIFY_SERVER_CERT )

Changes

This seems to be the simplest fix for this issue

Exception

[  Undefined constant Pdo\Mysql::ATTR_SSL_VERIFY_SERVER_CERT ]

vendor/laravel/framework/src/Illuminate/Database/Schema/MySqlSchemaState.php:133
    129▕         if (isset($config['options'][Mysql::ATTR_SSL_KEY])) ***
    130▕             $value .= ' --ssl-key="$***:LARAVEL_LOAD_SSL_KEY***"';
    131▕         ***
    132▕ 
  ➜ 133▕         if (($config['options'][Mysql::ATTR_SSL_VERIFY_SERVER_CERT] ?? null) === false) ***
    134▕             if (version_compare($versionInfo['version'], '5.7.11', '>=') && ! $versionInfo['isMariaDb']) ***
    135$value .= ' --ssl-mode=DISABLED';
    136▕             *** else ***
    137$value .= ' --ssl=off';

How to reproduce

Tests

  • I added the same check in the tests where I found reference to Pdo\Mysql::ATTR_SSL_VERIFY_SERVER_CERT

@YasserB94 YasserB94 force-pushed the fix/12.x-pdo-mysql-missing-constant branch from 6b9b1db to 128e620 Compare May 26, 2026 08:58
@jnoordsij
Copy link
Copy Markdown
Contributor

I think https://github.com/symfony/polyfill/releases/tag/v1.38.1 should fix this. Can you check that? If so, adding a conflict with the specific version 1.38.0 here should suffice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants