0

I was in need to install Php 5.6 with postgres. I followed the instructions from here and did:

brew install php56 --without-mysql --without-apache --with-postgresql
brew install php56-pdo-pgsql

Php 5.6 and postgres are running fine with my Projects using PostgreSQL.

Now there is some problem with Laravel projects using mysql. On running php artisan migrate command, it shows:

[PDOException]
could not find driver

Project works fine in the browser though. Data is being fetched perfectly from the mysql tables. php -m also does not shows mysql. But phpinfo does shows mysql module.

What could be the problem? Do i need to reinstall mysql?

Community
  • 1
  • 1
Kanav
  • 2,695
  • 8
  • 34
  • 56

1 Answers1

0

Probably, you would need to activate mysql extension in php Find your php.ini. Create a php file with following content and run it.
It will tell you where it is.

<?php phpinfo(); ?>

Just look at the path of loaded configuration file. Common places include /etc/apache/, /etc/php4/apache2/php.ini, /etc/php5/apache2/php.ini or even /usr/local/lib/php.ini for Windows it may be C:\Users\username\PHP\php.ini

Edit your server’s php.ini and look for the following line. Remove the ‘;’ from the start of the line and restart Apache. Things should work fine now!

;extension=mysql.so

should become

extension=mysql.so

For windows it will be

;extension=mysql.dll

should become

extension=mysql.dll

Restart your apache service to load the new configuration.

jaysingkar
  • 4,315
  • 1
  • 18
  • 26