Search code examples
phpmysqllaravellampmanjaro

could not find driver in laravel 5.4


i receive this error when sending a request from angular project .

could not find driver (SQL: insert into employees (name, address, gender, department_id, education, experiance, updated_at, created_at) values (Karly Frost, Aliquam quo anim illum et nisi occaecat quam ad ut eveniet animi natus, f, 2, Eveniet in ab architecto neque ut molestiae magnam aliquip deleniti dolores quia hic est nobis tempora rerum, Laboriosam reprehenderit sint minima dolore quis dolorem perferendis, 2018-05-20 22:54:20, 2018-05-20 22:54:20))

but when i try to add new record using

php artisan tinker command and execute insert query using laravel eloquent it works very well

else i got this exception

notice : i use arch manjaro as my linux distributions


Solution

  • You should install PDO on your server. Edit your php.ini (look at your phpinfo(), "Loaded Configuration File" line, to find the php.ini file path). Find and uncomment the following line (remove the ; character):

    ;extension=pdo_mysql.so
    

    Then, restart your Apache server. For more information, please read http://php.net/manual/en/pdo.installation.php.