-1

I tried to migrate my application to php8.2. On 8.1 it works perflectly.

I have the same configuration on my php.ini 8.1 and 8.2 and I have this error appears :

php 8.2 Undefined class constant 'MYSQL_ATTR_INIT_COMMAND' with pdo

Beloy my code :

  if (!isset($this->driver_options[\PDO::MYSQL_ATTR_INIT_COMMAND])) {
    // STRICT_ALL_TABLES 5.0.2
    // NO_ZERO_DATE 5.0.2
    // NO_ZERO_IN_DATE 5.0.2
    // ERROR_FOR_DIVISION_BY_ZERO 5.0.2
    // NO_ENGINE_SUBSTITUTION 5.0.8
    $this->driver_options[\PDO::MYSQL_ATTR_INIT_COMMAND] = 'set session sql_mode="STRICT_ALL_TABLES,NO_ZERO_DATE,NO_ZERO_IN_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION"';
  }

Do you any idea to resolve that ?

Thank you

yostijognu
  • 19
  • 3

1 Answers1

0

Find the solution, The problem come from the Cpanel php setting must be updated

yostijognu
  • 19
  • 3