how to fix Doctrine\DBAL issue

Viewed 1012

I am having an issue when I run php artisan migrate in laravel

[TypeError] Argument 1 passed to Doctrine\DBAL\Connection::ensureForwardCompatibilityStatement() must be an instance of Doctrine\DBAL\Driver\ResultStatement, instance of PDOStatement given

1 Answers

Out of curiosity, check the value of DB_PDO_PERSISTENT in your .env file: The error you mention will come up (as of doctrine/dbal:2.13.2) if the connection is persistent.

This will result in an error above:

DB_PDO_PERSISTENT=true

And this will be fine:

DB_PDO_PERSISTENT=false

PS: If you have to change it, don't forget to php artisan config:clear

Related