Skip to content

Fix PHP 8.5: KEY_MYSQL_SSL_VERIFY hardcoded as 1014 collides with ren…#40849

Open
shlrkb wants to merge 1 commit into
magento:2.4-developfrom
shlrkb:php85-key-mysql-ssl-verify
Open

Fix PHP 8.5: KEY_MYSQL_SSL_VERIFY hardcoded as 1014 collides with ren…#40849
shlrkb wants to merge 1 commit into
magento:2.4-developfrom
shlrkb:php85-key-mysql-ssl-verify

Conversation

@shlrkb
Copy link
Copy Markdown

@shlrkb shlrkb commented Jun 2, 2026

…amed Pdo\Mysql constant

PHP 8.5 removed ATTR_SERVER_PUBLIC_KEY, shifting all Pdo\Mysql constant values down by one. KEY_MYSQL_SSL_VERIFY was hardcoded as 1014 (a legacy workaround for PHP 7.1.3 support) which now maps to ATTR_LOCAL_INFILE_DIRECTORY instead of ATTR_SSL_VERIFY_SERVER_CERT, causing every Magento 2.4.9 installation on PHP 8.5 to crash on boot with an open_basedir error.

Apply the same PHP_VERSION_ID >= 80400 pattern already used for KEY_MYSQL_SSL_KEY, KEY_MYSQL_SSL_CERT and KEY_MYSQL_SSL_CA.

Description (*)

PHP 8.5 removed Pdo\Mysql::ATTR_SERVER_PUBLIC_KEY, shifting all constant integer values down by one. KEY_MYSQL_SSL_VERIFY was hardcoded as 1014 (legacy workaround for PHP 7.1.3). On PHP 8.5, 1014 is now ATTR_LOCAL_INFILE_DIRECTORY which expects a path — passing false crashes every installation on boot with an open_basedir PDOException.

Applies the same PHP_VERSION_ID >= 80400 pattern already used for KEY_MYSQL_SSL_KEY, KEY_MYSQL_SSL_CERT and KEY_MYSQL_SSL_CA.

Related Pull Requests

Manual testing scenarios (*)

  1. Fresh install Magento 2.4.9 on PHP 8.5 with open_basedir — crashes without fix
  2. Apply fix, reinstall — boots successfully
  3. Check env.php: driver_options contains 1013 => false (correct) instead of 1014 => false

Questions or comments

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • README.md files for modified modules are updated and included in the pull request if any README.md predefined sections require an update
  • All automated tests passed successfully (all builds are green)

Resolved issues:

  1. resolves [Issue] Fix PHP 8.5: KEY_MYSQL_SSL_VERIFY hardcoded as 1014 collides with ren… #40855: Fix PHP 8.5: KEY_MYSQL_SSL_VERIFY hardcoded as 1014 collides with ren…

…amed Pdo\Mysql constant

PHP 8.5 removed ATTR_SERVER_PUBLIC_KEY, shifting all Pdo\Mysql constant
values down by one. KEY_MYSQL_SSL_VERIFY was hardcoded as 1014 (a legacy
workaround for PHP 7.1.3 support) which now maps to ATTR_LOCAL_INFILE_DIRECTORY
instead of ATTR_SSL_VERIFY_SERVER_CERT, causing every Magento 2.4.9
installation on PHP 8.5 to crash on boot with an open_basedir error.

Apply the same PHP_VERSION_ID >= 80400 pattern already used for
KEY_MYSQL_SSL_KEY, KEY_MYSQL_SSL_CERT and KEY_MYSQL_SSL_CA.
@m2-assistant
Copy link
Copy Markdown

m2-assistant Bot commented Jun 2, 2026

Hi @shlrkb. Thank you for your contribution!
Here are some useful tips on how you can test your changes using Magento test environment.
❗ Automated tests can be triggered manually with an appropriate comment:

  • @magento run all tests - run or re-run all required tests against the PR changes
  • @magento run <test-build(s)> - run or re-run specific test build(s)
    For example: @magento run Unit Tests

<test-build(s)> is a comma-separated list of build names.

Allowed build names are:
  1. Database Compare
  2. Functional Tests CE
  3. Functional Tests EE
  4. Functional Tests B2B
  5. Integration Tests
  6. Magento Health Index
  7. Sample Data Tests CE
  8. Sample Data Tests EE
  9. Sample Data Tests B2B
  10. Static Tests
  11. Unit Tests
  12. WebAPI Tests
  13. Semantic Version Checker

You can find more information about the builds here
ℹ️ Run only required test builds during development. Run all test builds before sending your pull request for review.


For more details, review the Code Contributions documentation.
Join Magento Community Engineering Slack and ask your questions in #github channel.

@engcom-Hotel
Copy link
Copy Markdown
Contributor

@magento create issue

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

Labels

Priority: P1 Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing. Progress: pending review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Issue] Fix PHP 8.5: KEY_MYSQL_SSL_VERIFY hardcoded as 1014 collides with ren…

2 participants