Laravel: PDOException: could not find driver

前端 未结 21 2357
野趣味
野趣味 2020-11-27 05:06

I am developing a website on a server I only have access to MySQL and FTP, so all commands I run are through the b374k php shell . I am experiencing a Laravel problem with S

相关标签:
21条回答
  • 2020-11-27 05:34

    I had the same issue, and I uncomment extension=pdo_sqlite and ran the migration and everything worked fine.

    0 讨论(0)
  • 2020-11-27 05:34

    In case that you run test in sqlite run

    sudo apt install sqlite3 && sudo apt install php-sqlite3
    

    If you run test in window, you dont need install nothing. Only config your phpunit.xml

    0 讨论(0)
  • 2020-11-27 05:35

    Solution 1:

    1. php -v
    

    Output: PHP 7.3.11-1+ubuntu16.04.1+deb.sury.org+1 (cli)

    2. sudo apt-get install php7.3-mysql
    

    Solution 2:

    Check your DB credentials like DB Name, DB User, DB Password

    0 讨论(0)
  • 2020-11-27 05:36

    Even simpler in Ubuntu (18.04)

    apt install php-mysql

    Done. No need to edit any .ini files.

    Happy coding!

    0 讨论(0)
  • 2020-11-27 05:39

    If you can, run :

    composer update
    
    composer require doctrine/dbal
    

    It looks like you have a missing dependency

    Edit:

    You might need to comment out the following in your php.ini file.

    ;extension=pdo_mysql.so
    

    Taken from this post: Laravel 5 PDOException Could Not Find Driver . I think I had to do something exactly like this when setting up laravel on digital ocean.

    0 讨论(0)
  • 2020-11-27 05:39

    In Linux Download Mysql and Php

    sudo apt install php-mysql
    

    Then the problem will be solved.

    0 讨论(0)
提交回复
热议问题