Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

saimiris's avatar

'Doctrine\DBAL\Driver\PDOMySql\Driver' not found

Something very very strange is happening on my Laravel 5.1 app.

In local I don't have any problem at all when doing "artisan migrate" but in production (which is an exact copy of my local version) I get this error:

PHP Fatal error: Class 'Doctrine\DBAL\Driver\PDOMySql\Driver' not found in /var/www/vhosts/profexpress.com/v2/dev/vendor/laravel/framework/src/Illuminate/Database/MySqlConnection.php on line 64 [Symfony\Component\Debug\Exception\FatalErrorException] Class 'Doctrine\DBAL\Driver\PDOMySql\Driver' not found

I know I can solve this issue by adding "doctrine/dbal": "~2.3" to my composer.json file but I don't want to do that. I want my local and remote composer files to be the exact same.

Any idea how to solve that?

Many thanks.

0 likes
6 replies
wolle404's avatar

Do you have installed all your dependencies? Maybe composer install will solve the problem on your remote server.

vtalbot's avatar

Does any of your migrations change existing column? You'll have to add the "doctrine/dbal":"~2.3" in your composer.json in the require section instead of the require-dev. In local, it works because composer install install the development dependencies. But on the remote server, it doesn't.

saimiris's avatar

I tried to do composer install but no luck.

And no, I don't have any migrations change on existing columns.

What else can I try ?

vtalbot's avatar

Are the source available somewhere? Or can you provide the migrations and the composer.json files. All I see in the Laravel code is that doctrine/dbal is require only on column rename or stuff like.

boni's avatar

Thanks @vtalbot I have added the "doctrine/dbal":"~2.3" in my composer.json in the require section, as you indicated and then run command composer updated and it has solved the problem when running seeding 'Doctrine\DBAL\Driver\PDOMySql\Driver' not found

Please or to participate in this conversation.