Reputation: 11
I'm getting this error:
PDOException in Connector.php line 55: could not find driver
in Connector.php line 55
at PDO->__construct('mysql:host=localhost:8080;dbname=db', 'root', '', array('0', '2', '0', false, false)) in Connector.php line 55
On my .env file I have the credentials as
DB_HOST=localhost:8080
DB_DATABASE=db
DB_USERNAME=root
DB_PASSWORD=
My wamp is set to port 8080, and when my laravel is viewing on port 8000 via artisan serve. Is there a disconnect with this? All of the pdo modules are in the php.ini
Upvotes: 0
Views: 527
Reputation: 149
Remove port number 8080 from .env file as follows
DB_HOST=localhost
DB_DATABASE=db
DB_USERNAME=root
DB_PASSWORD=
Now try that by placing above values.
Don't forgot to restart your server.
Upvotes: 0
Reputation: 577
you are serving from two totally different environments, your wamp is probably using a different php version that your artisan. check where both of those php configs are located and install whatever drivers that are missing keep in mind php7 is missing a few pdo drivers if not all.
Upvotes: 0
Reputation: 5806
You didn't show your list of extensions.
php-cli.ini
php-cli.ini
:
php-cli.ini
exists? Check or add the lines to your php.iniI strongly recommend Homestead as your local development server.
Laravel Homestead is an official, pre-packaged Vagrant box that provides you a wonderful development environment without requiring you to install PHP, HHVM, a web server, and any other server software on your local machine. No more worrying about messing up your operating system! Vagrant boxes are completely disposable. If something goes wrong, you can destroy and re-create the box in minutes!
Homestead runs on any Windows, Mac, or Linux system, and includes the Nginx web server, PHP 7.0, MySQL, Postgres, Redis, Memcached, Node, and all of the other goodies you need to develop amazing Laravel applications (https://laravel.com/docs/master/homestead)
Upvotes: 0
Reputation: 138
I don't believe that you can use artisan serve with WAMP, as they are actually two different servers (artisan serve utilizes PHPs built in web server which has no relation to WAMP).
You should checkout this post to get an idea of how to setup Laravel to work with WAMP properly.
Upvotes: 1