3

I asked this question and followed the instructions.

  • I removed the default mysql driver sudo apt-get remove --purge php5-mysql
  • I installed the Native Driver sudo apt-get install php5-mysqlnd
  • I ran sudo php5dismod mysql && php5enmod mysqlnd
  • I restarted php5-fpm and nginx

At this point I was presented with the following error:

[2016-04-14 08:50:02] local.ERROR: exception 'PDOException' with message 'could not find driver' in /var/.../vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:47

Why does PDO say Could not find driver?

Community
  • 1
  • 1
Ash
  • 3,242
  • 2
  • 23
  • 35
  • *..Wow, thanks. I've learnt something new here and thanks for the link I wish I could've found that.* But, you ticked answer as correct there and even you replied. – Nana Partykar Apr 14 '16 at 09:14
  • Yes, this missing driver is a different issue to my question that was solved previously - i.e. the difference between homestead and a different set-up (which turned out to be the driver). Configuration of that driver is then a separate issue - also this is more an Nginx config issue not an Apache issue – Ash Apr 14 '16 at 09:15

1 Answers1

0

The solution (for php-fpm/nginx) was to modify the mysql.ini configuration within the mods-available directory.

sudo vi /etc/php5/mods-available/mysql.ini

I replaced: extensions=mysql.so with extension=mysqlnd.so

Ash
  • 3,242
  • 2
  • 23
  • 35