Skip to content

Constant PDO::MYSQL_ATTR_INIT_COMMAND is deprecated since 8.5, use Pdo\Mysql::ATTR_INIT_COMMAND instead #237

Closed

Description

@rossaddison

No duplicates 🥲.

  • I have searched for a similar issue in our bug tracker and didn't find any solutions.

Describe the bug

Php 8.5 due to be released in a weeks time November 22nd 2025. Testing rossaddison/invoice under 8.5. First php error I have encountered as follows:

Constant PDO::MYSQL_ATTR_INIT_COMMAND is deprecated since 8.5, use Pdo\Mysql::ATTR_INIT_COMMAND instead.

Please create a php8.5 branch and I will fork and issue a pull request to it.

Is this a regression?

No

To Reproduce

Setup rossaddison/invoice running under php8.5

Expected behaviour

A clear run.

Media prove

Stack trace: 
ErrorException: Constant PDO::MYSQL_ATTR_INIT_COMMAND is deprecated since 8.5, use Pdo\Mysql::ATTR_INIT_COMMAND instead in C:\wamp64\www\invoice\vendor\cycle\database\src\Config\MySQL\ConnectionConfig.php:30
Stack trace:
#0 C:\wamp64\www\invoice\vendor\yiisoft\config\src\Config.php(163): [constant expression]()
#1 C:\wamp64\www\invoice\config\common\params.php(389): Yiisoft\Config\Config::{closure:{closure:Yiisoft\Config\Config::buildFile():160}:162}()
#2 C:\wamp64\www\invoice\vendor\yiisoft\config\src\Config.php(173): require('...')
#3 C:\wamp64\www\invoice\vendor\yiisoft\config\src\Config.php(186): Yiisoft\Config\Config::{closure:Yiisoft\Config\Config::buildFile():160}()
#4 C:\wamp64\www\invoice\vendor\yiisoft\config\src\Config.php(116): Yiisoft\Config\Config->buildFile()
#5 C:\wamp64\www\invoice\vendor\yiisoft\config\src\Config.php(111): Yiisoft\Config\Config->buildGroup()
#6 C:\wamp64\www\invoice\vendor\yiisoft\config\src\Config.php(94): Yiisoft\Config\Config->buildGroup()
#7 C:\wamp64\www\invoice\vendor\yiisoft\config\src\Config.php(74): Yiisoft\Config\Config->runBuildParams()
#8 C:\wamp64\www\invoice\vendor\yiisoft\yii-runner\src\ApplicationRunner.php(156): Yiisoft\Config\Config->get()
#9 C:\wamp64\www\invoice\vendor\yiisoft\yii-runner\src\ApplicationRunner.php(189): Yiisoft\Yii\Runner\ApplicationRunner->getConfiguration()
#10 C:\wamp64\www\invoice\vendor\yiisoft\yii-runner\src\ApplicationRunner.php(144): Yiisoft\Yii\Runner\ApplicationRunner->createDefaultContainer()
#11 C:\wamp64\www\invoice\vendor\yiisoft\yii-runner-http\src\HttpApplicationRunner.php(195): Yiisoft\Yii\Runner\ApplicationRunner->getContainer()
#12 C:\wamp64\www\invoice\vendor\yiisoft\yii-runner-http\src\HttpApplicationRunner.php(161): Yiisoft\Yii\Runner\Http\HttpApplicationRunner->runInternal()
#13 C:\wamp64\www\invoice\public\index.php(42): Yiisoft\Yii\Runner\Http\HttpApplicationRunner->run()
#14 {main}

Database

MySQL

Your environment

No response

Additional context

No response

Activity

  1. changed the title [-][Bug]: Constant PDO::MYSQL_ATTR_INIT_COMMAND is deprecated since 8.5, use Pdo\Mysql::ATTR_INIT_COMMAND instead[/-] [+]Constant PDO::MYSQL_ATTR_INIT_COMMAND is deprecated since 8.5, use Pdo\Mysql::ATTR_INIT_COMMAND instead[/+] on Nov 15, 2025
  2. jauhenis commented on Jan 5, 2026

    @jauhenis

    Same problem here, it's January 2026, want to update to 8.5, no luck with cycle/database

  3. roxblnfk commented on Jan 5, 2026

    @roxblnfk
    Member

    ATTR_INIT_COMMAND appeared in PHP 8.4.
    This means we'll have to raise the minimum version to 8.4 or look for workarounds.

  4. added and removed on Jan 5, 2026
  5. added theissue type on Jan 5, 2026
  6. changed the issue type fromtoon Jan 5, 2026
  7. jettero777 commented on Feb 3, 2026

    @jettero777

    This means we'll have to raise the minimum version to 8.4

    for master branch it would be natural because 8.4 and 8.5 are only PHP versions now in active support
    https://www.php.net/supported-versions.php

  8. jauhenis commented on Feb 16, 2026

    @jauhenis

    This means we'll have to raise the minimum version to 8.4 or look for workarounds.

    Maybe just use PHP version constant to ensure that all what's older than 8.4 is using old constant and all, what's newer like 8.5 - uses new constant.

    Really do want to use new 8.5 feature and all my project is ready for an update, except for cycle orm

  9. roxblnfk commented on Feb 16, 2026

    @roxblnfk
    Member

    Should be fixed in 2.15.2. Could you check?

  10. jauhenis commented on Feb 17, 2026

    @jauhenis

    Should be fixed in 2.15.2. Could you check?

    Yeah, it's great now, no deprecations, works on 8.5.3, thanks

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions