mercredi 3 juin 2020

PDO Exception "Could not find driver" error

I am new in Laravel. From last 2 days i am trying to migrate database from laravel to xampp. But every time i am getting PDO Exception "Could not find driver" error. I am getting 2 error:

1 C:\xampp\htdocs\student\vendor\laravel\framework\src\Illuminate\Database\Connectors\Connector.php:70
      PDOException::("could not find driver")

  2   C:\xampp\htdocs\student\vendor\laravel\framework\src\Illuminate\Database\Connectors\Connector.php:70
      PDO::__construct("mysql:host=127.0.0.1;port=3306;dbname=student", "root", "", [])


could not find driver (SQL: select * from information_schema.tables where table_schema = student and table_name = migrations and table_type = 'BASE TABLE')

I searched it on stackoverflow and many other websites and got many solutions but it's not working for me. I am still getting these errors.
I also added all required extensions which i got from multiple solutions of stackoverflow it self. But still it's not working. I am attaching code whatever i did. Can anyone help me to find what i did wrong in this? Thanks in Advance!!!

2020_06_04_052746_create_student_table.php

 public function up()
    {
        Schema::create('student', function (Blueprint $table) {
            $table->increments('id');
            $table->string('name');
            $table->string('email');
            $table->string('class');
            $table->int('pnumber');
            $table->timestamps();
        });
    }

php.ini

;
extension=bz2
extension=curl
;extension=ffi
;extension=ftp
extension=fileinfo
extension=gd2
extension=gettext
;extension=gmp
;extension=intl
;extension=imap
;extension=ldap
extension=mbstring
extension=exif      ; Must be after mbstring as it depends on it
extension=mysqli
;extension=oci8_12c  ; Use with Oracle Database 12c Instant Client
;extension=odbc
;extension=openssl
;extension=pdo_firebird
extension=pdo_mysql
;extension=pdo_oci
;extension=pdo_odbc
;extension=pdo_pgsql
extension=pdo_sqlite
;extension=pgsql
;extension=shmop
extension=php_pdo_mysql.dll
extension=php_mysql

.env

APP_NAME=Laravel
APP_ENV=local
APP_KEY=base64:v1jSrBPyR1wLOC96ePXWY0RRoTVuzNE3h+BB68RNqwI=
APP_DEBUG=true
APP_URL=http://localhost

LOG_CHANNEL=stack

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=student
DB_USERNAME=root
DB_PASSWORD=

after executing php --ini command

Configuration File (php.ini) Path: C:\WINDOWS
Loaded Configuration File:         C:\php\php.ini
Scan for additional .ini files in: (none)
Additional .ini files parsed:      (none)


via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire