Skip to content

laravel PDO invalid attribute exception with PHP 8.2.9/8.1.22 #47937

Closed
@ssswang

Description

Laravel Version

10.17

PHP Version

8.2.9

Database Driver & Version

php_pdo_sqlsrv_82_ts_x64 5.11, Microsoft sql server 2019

Description

PHP just released a new minor version 8.1.22 / 8.2.9.
There are some changes related to PDO.

My applications work fine with php 8.1/8.2 previous minor versions.

With 8.1.22 (laravel 9.* ) or 8.2.9 (laravel 10.* ), have a connection to a Microsoft sql server 2019, with official Microsoft database php pdo driver,

I got
Illuminate \ Database \ QueryException SQLSTATE[IMSSP]: An invalid attribute was designated on the PDO object.

for any queries in laravel.

I have also tested with raw php, pdo seems working fine.

It seems related to this line
https://github.com/laravel/framework/blob/10.x/src/Illuminate/Database/Connectors/SqlServerConnector.php#L19

Steps To Reproduce

  • laravel application with php 8.1.22/8.2.9 and Microsoft pdo driver, either windows or linux,
  • connecting to a Microsoft sql server
  • do a query in laravel.

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions