You are not logged in.

#1 2017-11-07 12:04:47

kurbar
Member
Registered: 2017-11-07
Posts: 1

PHP 7.1 unable to get PDO drivers to load

Hello,

I recently installed Arch on a VPS and installed Nginx, MariaDB and PHP 7.1 also. I did some preliminary configurations and also deployed a Laravel application to it.

When I wanted to run the database migrations for my application I stumbled across the error:

[PDOException] could not find driver

The driver in question is the mysql driver.

I checked the list of installed modules with php -m and it shows that PDO is loaded but no PDO_mysql.

I checked the modules directory under /usr/lib/php/modules and it has pdo_mysql.so in the directory. In php.ini I have the extension_dir set to /usr/lib/php/modules.

I then checked the info output using php -i and I see that PDO is enabled but no drivers are loaded.

> php -i | grep PDO
PDO
PDO support => enabled
PDO drivers =>


I then checked what configuration file is loaded and it shows that /etc/php/php.ini is loaded which is the correct file.

Then out of curiosity I tried installing php-pgsql package to get the PDO_pgsql extension to see if that would get installed.

I did the necessary restarts to php-fpm and then checked the output of php -m. Again it still has only PDO but no PDO_pgsql. I checked the /usr/lib/php/modules directory and I can see pgsql.so and pdo_pgsql.so. I checked output of php -i and again it shows PDO support is enabled but no drivers are loaded.

I feel like I am missing something but can't really wrap my head around what it could be.
Any help is appreciated.

Offline

#2 2017-11-07 14:00:54

robg
Member
Registered: 2015-03-05
Posts: 218

Re: PHP 7.1 unable to get PDO drivers to load

As it appears, drivers need to be added manually in the php.ini file. Have you done that?

Offline

#3 2017-11-07 16:57:52

loqs
Member
Registered: 2014-03-06
Posts: 17,321

Re: PHP 7.1 unable to get PDO drivers to load

Offline

#4 2017-11-08 08:28:01

robg
Member
Registered: 2015-03-05
Posts: 218

Re: PHP 7.1 unable to get PDO drivers to load

@logs Completely forgot about the git repo. Good thought to have a look it, will keep that in mind!

Last edited by robg (2017-11-08 08:59:25)

Offline

Board footer

Powered by FluxBB