skip to Main Content
   IlluminateDatabaseQueryException 

  could not find driver (Connection: mysql, SQL: select * from `site_settings` order by `created_at` desc limit 1)

  at vendorlaravelframeworksrcIlluminateDatabaseConnection.php:829
    825▕                     $this->getName(), $query, $this->prepareBindings($bindings), $e
    826▕                 );
    827▕             }
    828▕
  ➜ 829▕             throw new QueryException(
    830▕                 $this->getName(), $query, $this->prepareBindings($bindings), $e
    831▕             );
    832▕         }
    833▕     }

  1   [internal]:0
      IlluminateFoundationApplication::IlluminateFoundation{closure}(Object(AppProvidersAppServiceProvider))

  2   vendorlaravelframeworksrcIlluminateDatabaseConnectorsConnector.php:65
      PDOException::("could not find driver")

run my laravel application

2

Answers


  1. You need to uncomment the "pdo_mysql" extension from your php.ini file,
    just remove the ";" form the start of the following line:

    ;extension=pdo_mysql.so
    
    Login or Signup to reply.
  2. The error message "could not find driver" indicates that your Laravel application cannot find the necessary PDO driver for MySQL. This typically happens because the PDO MySQL extension is not installed or not enabled on your system

    Open your php.ini file, which is located in your PHP installation directory.
    Ensure the following line is uncommented (remove the ; at the beginning):
    ini
    Copy code
    extension=pdo_mysql
    Save the php.ini file and restart your web server (e.g., Apache, Nginx).

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search