gpt4 book ai didi

php - PDOException 找不到驱动程序

转载 作者:太空宇宙 更新时间:2023-11-03 11:34:08 29 4
gpt4 key购买 nike

<分区>

使用

连接到 mysql 数据库时出现 PDOException 找不到驱动程序
$this->conn = new PDO("mysql:host=" . $this->host . ";dbname=" . $this->db_name, $this->username, $this->password);

在 Windows 10 的本地主机上。我还尝试用 127.0.0.1 替换本地主机。

php信息(): enter image description here

enter image description here

C:\php\php.ini:

extension_dir = "C:/php/ext"
;extension=php_bz2.dll
;extension=php_curl.dll
;extension=php_fileinfo.dll
;extension=php_gd2.dll
;extension=php_gettext.dll
;extension=php_gmp.dll
;extension=php_intl.dll
;extension=php_imap.dll
;extension=php_interbase.dll
;extension=php_ldap.dll
;extension=php_mbstring.dll
;extension=php_exif.dll
extension=php_mysql.dll
;extension=php_mysqli.dll
;extension=php_oci8_12c.dll
;extension=php_openssl.dll
;extension=php_pdo.dll
;extension=php_pdo_firebird.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
;extension=php_pgsql.dll
;extension=php_shmop.dll

C:\Apache24\conf\httpd.conf:

LoadModule php5_module "C:/php/php5apache2_4.dll"
AddHandler application/x-httpd-php .php
PHPIniDir "C:/php"

php -m

[PHP Modules]
bcmath
calendar
Core
ctype
date
dom
ereg
filter
ftp
hash
iconv
json
libxml
mcrypt
mhash
mysql
mysqli
mysqlnd
odbc
pcre
PDO
pdo_mysql
Phar
Reflection
session
SimpleXML
SPL
standard
tokenizer
wddx
xml
xmlreader
xmlwriter
zip
zlib

[Zend Modules]

C:\php\ext 内容:

25.10.2017  15:23            79 872 php_bz2.dll
25.10.2017 15:23 87 040 php_com_dotnet.dll
25.10.2017 15:23 478 208 php_curl.dll
25.10.2017 15:23 23 040 php_enchant.dll
25.10.2017 15:23 56 320 php_exif.dll
25.10.2017 15:23 2 874 880 php_fileinfo.dll
25.10.2017 15:23 1 504 768 php_gd2.dll
25.10.2017 15:23 48 128 php_gettext.dll
25.10.2017 15:23 359 936 php_gmp.dll
25.10.2017 15:23 911 360 php_imap.dll
25.10.2017 15:23 80 896 php_interbase.dll
25.10.2017 15:23 326 656 php_intl.dll
25.10.2017 15:23 218 624 php_ldap.dll
25.10.2017 15:23 1 413 632 php_mbstring.dll
25.10.2017 15:23 45 056 php_mysql.dll
25.10.2017 15:23 113 664 php_mysqli.dll
25.10.2017 15:23 147 456 php_oci8_12c.dll
25.10.2017 15:23 158 208 php_opcache.dll
25.10.2017 15:23 105 472 php_openssl.dll
25.10.2017 15:23 24 576 php_pdo_firebird.dll
25.10.2017 15:23 28 672 php_pdo_mysql.dll
25.10.2017 15:23 28 672 php_pdo_oci.dll
25.10.2017 15:23 24 576 php_pdo_odbc.dll
25.10.2017 15:23 39 936 php_pdo_pgsql.dll
25.10.2017 15:23 603 648 php_pdo_sqlite.dll
25.10.2017 15:23 117 760 php_pgsql.dll
25.10.2017 15:23 14 336 php_shmop.dll
25.10.2017 15:23 406 528 php_snmp.dll
25.10.2017 15:23 285 184 php_soap.dll
25.10.2017 15:23 68 608 php_sockets.dll
25.10.2017 15:23 761 856 php_sqlite3.dll
25.10.2017 15:23 38 912 php_sybase_ct.dll
25.10.2017 15:23 284 160 php_tidy.dll
25.10.2017 15:23 63 488 php_xmlrpc.dll
25.10.2017 15:23 285 696 php_xsl.dll

系统路径:

C:\php
C:\php\ext
C:\Apache24
C:\Apache24/bin

我需要更多驱动程序吗?还是有其他问题?

如果您需要更多信息,我会提供。

谢谢大家的建议

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com