Solve Error Lumen could not find driver Postgresql on Ubuntu 20.04




In this noted, I will share how to solve error Lumen could not find driver when running php artisan migrate on Ubuntu 20.04.


1. first check version PHP on your system


root@arashy:/home/aulian# php -v

PHP 7.4.3 (cli) (built: May 5 2020 12:14:27) ( NTS )

Copyright (c) The PHP Group

Zend Engine v3.4.0, Copyright (c) Zend Technologies

with Zend OPcache v7.4.3, Copyright (c), by Zend Technologies


2. install driver php pgsql with running this command, don’t forget to adjust php version


root@arashy:/home/aulian# apt install php7.4-pgsql

Reading package lists... Done

Building dependency tree

Reading state information... Done

The following packages were automatically installed and are no longer required:

libaudclient2 libid3tag0 libimlib2 liblua5.1-0 libxmmsclient6

Use 'sudo apt autoremove' to remove them.

The following NEW packages will be installed:

php7.4-pgsql

0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.

Need to get 57,0 kB of archives.

After this operation, 233 kB of additional disk space will be used.

Get:1 http://id.archive.ubuntu.com/ubuntu focal-updates/main amd64 php7.4-pgsql amd64 7.4.3-4ubuntu1.1 [57,0 kB]

Fetched 57,0 kB in 2s (27,9 kB/s)

Selecting previously unselected package php7.4-pgsql.

(Reading database ... 213778 files and directories currently installed.)

Preparing to unpack .../php7.4-pgsql_7.4.3-4ubuntu1.1_amd64.deb ...

Unpacking php7.4-pgsql (7.4.3-4ubuntu1.1) ...

Setting up php7.4-pgsql (7.4.3-4ubuntu1.1) ...


Creating config file /etc/php/7.4/mods-available/pgsql.ini with new version


Creating config file /etc/php/7.4/mods-available/pdo_pgsql.ini with new version

Processing triggers for php7.4-fpm (7.4.3-4ubuntu1.1) ...

Processing triggers for php7.4-cli (7.4.3-4ubuntu1.1) …


3. after install driver, you can try to running php artisan migrate again. Thanks :)

Post a Comment

Previous Post Next Post