Laravel: PDOException: could not find driver

前端 未结 21 2358
野趣味
野趣味 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:39

    Some Additional information for people who upgraded their php version.

    This is for laravel framework using MySql or MariaDB.

    I had issues after upgrading php version from 7.2 to 7.4.

    1. Make sure you completely install php extentions and packages for php version 7.4 (Or your installed php version).
    2. Make sure you enable these extentions. pdo_mysql, xmlrpc, mbstring, mysqli, openssl, fileinfo, gd2, curl at php.ini.
    3. Then clear cache, config
    4. Restart all services such as apache, supervisor
    0 讨论(0)
  • 2020-11-27 05:40

    First check php -m
    .If you don't see mysql driver install mysql sudo apt-cache search php-mysql
    Your results will be similar to:

    php-mysql - MySQL module for PHP [default]
    


    install php- mysql Driver

    sudo apt-get install php7.1-mysql
    
    0 讨论(0)
  • 2020-11-27 05:42

    I had a similar issue in Ubuntu 16.04 and what help me was that i installed php-mysql for php 7.2. I would recommend you run the following command if you have php 7.2 or install php mysql depending on your version of PHP. Make sure that you have installed the DBAL packege

    apt-get install php7.2-mysql
    
    systemctl restart apache2
    
    0 讨论(0)
  • 2020-11-27 05:44

    In CentOS7,I try this: yum install php-mysql, then edit php.ini

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

    if you have installed new version of php 7.2+ then you have to uncomment this line in php.ini ;extension=pdo_mysql

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

    For me, php.ini was OK, but I needed to restart php artisan serve.

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