Skip to content

Fix PHP 8.5 deprecation for PDO::MYSQL_ATTR_SSL_CA - #4614

Merged
jbrooksuk merged 1 commit into
3.xfrom
fix-mysql-php85-deprecations
Apr 30, 2026
Merged

Fix PHP 8.5 deprecation for PDO::MYSQL_ATTR_SSL_CA#4614
jbrooksuk merged 1 commit into
3.xfrom
fix-mysql-php85-deprecations

Conversation

@jbrooksuk

Copy link
Copy Markdown
Member

Summary

  • Replace deprecated PDO::MYSQL_ATTR_SSL_CA with Pdo\Mysql::ATTR_SSL_CA on PHP 8.4+, falling back to the old constant on PHP 8.2/8.3.
  • Avoids the PHP 8.5 deprecation notice: Constant PDO::MYSQL_ATTR_SSL_CA is deprecated since 8.5, use Pdo\Mysql::ATTR_SSL_CA instead.

The new Pdo\Mysql class was introduced in PHP 8.4, so a PHP_VERSION_ID check is required while composer.json still allows php: ^8.2.

Test plan

  • Boot the app on PHP 8.5 and confirm the deprecation no longer fires.
  • Boot the app on PHP 8.2/8.3 and confirm PDO::MYSQL_ATTR_SSL_CA is still used (no Class "Pdo\Mysql" not found error).
  • Verify MySQL/MariaDB connections still negotiate SSL when MYSQL_ATTR_SSL_CA is set.

馃 Generated with Claude Code

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@jbrooksuk
jbrooksuk merged commit 5ddf5b7 into 3.x Apr 30, 2026
2 checks passed
@jbrooksuk
jbrooksuk deleted the fix-mysql-php85-deprecations branch May 5, 2026 11:03
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.

1 participant