wogle 2017-04-19 04:40 采纳率: 33.3%
浏览 1677
已采纳

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条回答 默认 最新

  • wogle 2017-04-19 06:18
    关注

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

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog
  • ¥15 Excel发现不可读取的内容
  • ¥15 关于#stm32#的问题:CANOpen的PDO同步传输问题
  • ¥20 yolov5自定义Prune报错,如何解决?