我有下一个错误:
IlluminateDatabaseQueryException
include(/home/xxxx/xxxxxx/vendor/composer/../doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php): failed to open stream: No such file or directory (SQL: select * from `users`)
我试图将.env和database.php主机更改为localhost或127.0.0.1,或将端口更改为33060,composer更新/安装/转储自动加载等(我在网站上找到的所有解决方案(
'mysql' => [
'driver' => 'mysql',
'url' => env('DATABASE_URL'),
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '3306'),
'database' => env('DB_DATABASE', 'xxxxx'),
'username' => env('DB_USERNAME', 'xxxx'),
'password' => env('DB_PASSWORD', 'xxxx'),
'unix_socket' => env('DB_SOCKET', '/var/lib/mysql/mysql.sock'),
'charset' => 'utf8mb4',
'collation' => 'utf8mb4_unicode_ci',
'prefix' => '',
'prefix_indexes' => true,
'strict' => true,
'engine' => null,
'options' => extension_loaded('pdo_mysql') ? array_filter([
PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
]) : [],
],
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
Laravel框架6.18.6
有一种更强大的方法可以清理混乱的安装。。。
composer dumpautoload
对我来说,几乎每次都有效,包括遇到这种特殊错误的情况。