我的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
使用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
请知道什么原因的大神指教,感激不尽!