php mysqli_connect()不能用 ,找不到pdo driver

我的apache服务器能正常启用,php代码也能正常运行,但涉及到数据库的就出问题了!
php.ini已正常配置:
extension_dir = "c:/php7/ext"

extension=php_bz2.dll
;extension=php_curl.dll
;extension=php_fileinfo.dll
;extension=php_ftp.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 ; Must be after mbstring as it depends on it
extension=php_mysqli.dll
;extension=php_oci8_12c.dll ; Use with Oracle Database 12c Instant Client
extension=php_openssl.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

但在phpinfo()里Loaded Configuration File   为none

另外只有一个pdo表,不见mysqli表:图片说明

使用pdo $con= new PDO("localhost:3306","username","password");
出现

Fatal error: Uncaught PDOException: could not find driver in C:\Apache24\htdocs\demo.com\register.php:27 Stack trace: #0 C:\Apache24\htdocs\demo.com\register.php(27): PDO->__construct('localhost:3306', 'username', 'password') #1 {main} thrown in C:\Apache24\htdocs\demo.com\register.php on line 27

使用mysqli_connect $con= mysqli_connect("localhost:3306","username","password");
出现
Fatal error: Uncaught Error: Call to undefined function mysqli_connect() in C:\Apache24\htdocs\demo.com\register.php:27 Stack trace: #0 {main} thrown in C:\Apache24\htdocs\demo.com\register.php on line 27

我的php版本是7.13,apache2.4.25,mysql5.7

请知道什么原因的大神指教,感激不尽!

2个回答

我重装了php,配置完php.ini后,然后问题解决了,如果有遇到这个问题的,可以试试这个方法

其实是你只装了PDO扩展没有安装PDO_Mysql扩展 PDO只是接口,Pdo_mysql才是针对mysql的实现

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!