Skip to content

Fix use of deprecated driver specific PDO constants #57141

@jnoordsij

Description

@jnoordsij

Laravel Version

12.30.1

PHP Version

8.5.0beta3

Database Driver & Version

No response

Description

As of PHP 8.5, accessing driver specific PDO constants through PDO is deprecated; see https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_driver_specific_pdo_constants_and_methods. The preferred way is to refer to the corresponding driver subclass for such constants; see also https://wiki.php.net/rfc/pdo_driver_specific_subclasses.

As far as I can see, this is limited to the usage of PDO::MYSQL_ATTR_SSL_CA, which should be replaced with \Pdo\Mysql::ATTR_SSL_CA. However, with the latter requiring PHP 8.4+, some backwards compatible implementation will be required. I'm willing to provide a fix, but am wondering on how to approach this.

Steps To Reproduce

Running e.g. tests will yield a message
[22-Sep-2025 15:18:37 UTC] PHP Deprecated: Constant PDO::MYSQL_ATTR_SSL_CA is deprecated since 8.5, use Pdo\Mysql::ATTR_SSL_CA instead in /app/path/vendor/laravel/framework/config/database.php on line 64

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions