My Laravel Project is working fine on localhost, but when I hosting this on cpanel and try to login or register. it's through me this error like could not find driver (SQL: select * from
userswhere
email= me@me.com limit 1)
. What Should I do..??

- 42,008
- 16
- 111
- 154

- 470
- 2
- 6
- 27
-
Did you configure your environment using the .env file? What value did you use for `DB_CONNECTION`? – MaartenDev Aug 18 '19 at 19:24
-
Yes, this my connection `DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=nextnir_next DB_USERNAME=nextnir_nexto DB_PASSWORD=nextnir@next` – Shekh Saifuddin Aug 18 '19 at 19:27
-
1Are you sure mysql is installed on that environment? Could you add a route that executes `phpinfo();` to further debug this issue? – MaartenDev Aug 18 '19 at 19:32
-
Actually I don't know how to install mysql on live server, and where I find this `phpinfo();` ? – Shekh Saifuddin Aug 18 '19 at 19:38
-
1Possible duplicate of [Laravel 5 PDOException Could Not Find Driver](https://stackoverflow.com/questions/35240414/laravel-5-pdoexception-could-not-find-driver) There are already plenty of this type of questions with correct answers that a simple research can find. – dparoli Aug 18 '19 at 20:10
2 Answers
You probably didn't enable PDO extension . In your cpanel select
SOFTWARE > Select PHP Version
You see all extensions there , enable these extensions :
pdo ,mysqlnd , ndmysqli , nd_pdo_mysql

- 161
- 4
-
had almost the same problem, nd_pdo_mysql was not enabled by default in cPanel on the hosting server. Thanks @Mnikoei – Ivar Mortulev Jan 27 '20 at 12:26
-
First of all, I want to thank all of you guys, I find another solution to solve this kind problem, What I have done just in my .htaccess
file this line of code
# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php71” package as the default “PHP” programming language.
<IfModule mime_module>
AddHandler application/x-httpd-ea-php71 .php .php7 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit
and change
DB_USERNAME=something
DB_PASSWORD=something
and my problem is solved, this is enabled mysql
also, Thank you guys Happy Coding....

- 470
- 2
- 6
- 27