laravel 找不到驱动程序(SQL:select * from information_schema.tables where table_schema=aas2api_research and table_name=migrations and[...]

jyztefdp  于 2023-03-31  发布在  其他
关注(0)|答案(1)|浏览(152)

我试图做一个php工匠迁移.我使用PHPStorm,windows 11,xampp作为服务器和php7.4.版本.迁移时,我得到以下错误:

**************************************
*     Application In Production!     *
**************************************

 Do you really wish to run this command? (yes/no) [no]:
 > yes

In Connection.php line 712:
                                                                                                                                                                        
  could not find driver (SQL: select * from information_schema.tables where table_schema = aas2api_research and table_name = migrations and table_type = 'BASE TABLE')  
                                                                                                                                                                        

In Exception.php line 18:
                         
  could not find driver  
                         

In PDOConnection.php line 40:
                         
  could not find driver

我的.env文件看起来像这样:

APP_ENV=local
APP_DEBUG=true
APP_KEY=base64:ADD+G66Hzv/qpuVy0l7o/aeBeB/HRKugz8LrbMT5rmI=

DB_CONNECTION=mysql
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=aas2api_research
DB_USERNAME=root

我的config/database.php看起来像这样:

'connections' => [

        'sqlite' => [
            'driver' => 'sqlite',
            'database' => database_path('database.sqlite'),
            'prefix' => '',
        ],

        'mysql' => [
            'driver' => 'mysql',
            'host' => env('DB_HOST', 'localhost'),
            'database' => env('DB_DATABASE', 'forge'),
            'username' => env('DB_USERNAME', 'forge'),
            'password' => env('DB_PASSWORD', ''),
            'charset' => 'utf8',
            'collation' => 'utf8_unicode_ci',
            'prefix' => '',
            'strict' => false,
        ],

        'pgsql' => [
            'driver' => 'pgsql',
            'host' => env('DB_HOST', 'localhost'),
            'database' => env('DB_DATABASE', 'forge'),
            'username' => env('DB_USERNAME', 'forge'),
            'password' => env('DB_PASSWORD', ''),
            'charset' => 'utf8',
            'prefix' => '',
            'schema' => 'public',
        ],

我已经做了以下工作:
在config/database.php中,我将行'database' => database_path('database.sqlite'),改为'database' => env('DB_DATABASE', database_path('database.sqlite')),
我的环境变量系统路径具有以下行:C:\程序文件\php-7.4.33-Win32-vc 15
启动XAMPP后,我在http://localhost/dashboard/phpinfo.php中搜索了我的php.ini文件。我在C:\xampp\php\php.ini中找到了它。我重新启动了我的服务器,它不工作
我取消了extension=pdo_mysql的注解。我查看了ext文件夹,里面没有pdo_mysql,我还尝试了extension=pdo_mysqli的注解和取消注解
在下面代码的Onwindows行下面,我也取消了注解extfile行

; Directory in which the loadable extensions (modules) reside.
; http://php.net/extension-dir
;extension_dir = "./"
; On windows:
extension_dir="C:\xampp\php\ext"

所以基本上我尝试了我在互联网上找到的所有东西,没有任何帮助。有人有其他想法吗?非常感谢!

a2mppw5e

a2mppw5e1#

对于有同样问题的人:我的项目工作之前,我的笔记本电脑升级到Windows 11.所以做了一个干净的新下载回到Windows 10一切都工作正常了.希望,它会帮助别人在未来.

相关问题