最近在我的计算机上重新安装了 Ubuntu 21.04,并安装了 php8 和 Nginx。我运行 Laravel 服务器,当我转到 localhost:8000 时出现此错误:
Illuminate\Database\QueryException
could not find driver (SQL: select * from `sessions` where `id` =
k8TiDjzbt96oJgAhUkwhOzJO0dYUcctBdLCLuvTK limit 1)
http://localhost:8000/
我认为这个错误来自PDO。
当我转到 localhost/phpmyadmin 时出现此错误:
404 Not Found
nginx/1.18.0 (Ubuntu)
当我php -m
在终端中输入:
[PHP Modules]
calendar
Core
ctype
curl
date
dom
exif
FFI
fileinfo
filter
ftp
gd
gettext
hash
iconv
igbinary
imap
intl
json
libxml
mbstring
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
pdo_sqlite
Phar
posix
readline
redis
Reflection
session
shmop
SimpleXML
snmp
soap
sockets
sodium
SPL
sqlite3
standard
sysvmsg
sysvsem
sysvshm
tokenizer
xml
xmlreader
xmlwriter
xsl
Zend OPcache
zip
zlib
[Zend Modules]
当我在 php.ini 文件中搜索 pdo 时:
[Pdo]
; Whether to pool ODBC connections. Can be one of "strict", "relaxed" or "off"
; http://php.net/pdo-odbc.connection-pooling
;pdo_odbc.connection_pooling=strict
[Pdo_mysql]
; Default socket name for local MySQL connects. If empty, uses the built-in
; MySQL defaults.
pdo_mysql.default_socket=
;extension=php_pdo_firebird.dll
;extension=php_pdo_mssql.dll
;extension=php_pdo_mysql.dll
;extension=php_pdo_oci.dll
;extension=php_pdo_odbc.dll
;extension=php_pdo_pgsql.dll
;extension=php_pdo_sqlite.dll
我的Xampp版本是8.0.12
我还将 PostgreSQL 用于我的 Django 项目。