PHP无法连接MySQLi函数
PHP脚本如下:<?php$conn=mysqli_connect("localhost","root","1984","MySQLDB");if(empty($conn...
PHP脚本如下:
<?php
$conn = mysqli_connect("localhost", "root", "1984", "MySQLDB");
if (empty($conn)) {
die("mysqli_connect failed: " . mysqli_connect_error());
}
echo("connected to " . mysqli_get_host_info($conn) . "\n");
mysqli_close($conn);
?>
PHP配置文件如下:
;extension=php_bz2.dll
;extension=php_curl.dll
;extension=php_dba.dll
;extension=php_dbase.dll
;extension=php_exif.dll
;extension=php_fdf.dll
;extension=php_gd2.dll
;extension=php_gettext.dll
;extension=php_gmp.dll
;extension=php_ifx.dll
;extension=php_imap.dll
;extension=php_interbase.dll
;extension=php_ldap.dll
extension=php_mbstring.dll
;extension=php_mcrypt.dll
;extension=php_mhash.dll
;extension=php_mime_magic.dll
;extension=php_ming.dll
;extension=php_msql.dll
extension=php_mssql.dll
extension=php_mysql.dll
extension=php_mysqli.dll
;extension=php_oci8.dll
;extension=php_openssl.dll
;extension=php_pdo.dll
;extension=php_pdo_firebird.dll
;extension=php_pdo_mssql.dll
;extension=php_pdo_mysql.dll
;extension=php_pdo_oci.dll
;extension=php_pdo_oci8.dll
;extension=php_pdo_odbc.dll
;extension=php_pdo_pgsql.dll
;extension=php_pdo_sqlite.dll
;extension=php_pgsql.dll
;extension=php_pspell.dll
;extension=php_shmop.dll
;extension=php_snmp.dll
;extension=php_soap.dll
;extension=php_sockets.dll
;extension=php_sqlite.dll
;extension=php_sybase_ct.dll
;extension=php_tidy.dll
;extension=php_xmlrpc.dll
;extension=php_xsl.dll
;extension=php_zip.dll
执行的时候出现:
Fatal error: Call to undefined function mysqli_connect() in C:\Program Files\Apache Group\Apache2\www\connectMysql.php on line 2
请高手帮忙看看为什么连不上数据库?
libmysql.dll这个已经复制,也不行,
@ $conn = new mysqli("localhost", "root", "1984", "MySQLDB"); 这个也已试过 也是不行
现在出现这个错误:
Fatal error: Class 'mysqli_connect' not found in C:\Program Files\Apache Group\Apache2\www\connectMysql.php on line 2
我的PHP是直接解压缩的。 展开
<?php
$conn = mysqli_connect("localhost", "root", "1984", "MySQLDB");
if (empty($conn)) {
die("mysqli_connect failed: " . mysqli_connect_error());
}
echo("connected to " . mysqli_get_host_info($conn) . "\n");
mysqli_close($conn);
?>
PHP配置文件如下:
;extension=php_bz2.dll
;extension=php_curl.dll
;extension=php_dba.dll
;extension=php_dbase.dll
;extension=php_exif.dll
;extension=php_fdf.dll
;extension=php_gd2.dll
;extension=php_gettext.dll
;extension=php_gmp.dll
;extension=php_ifx.dll
;extension=php_imap.dll
;extension=php_interbase.dll
;extension=php_ldap.dll
extension=php_mbstring.dll
;extension=php_mcrypt.dll
;extension=php_mhash.dll
;extension=php_mime_magic.dll
;extension=php_ming.dll
;extension=php_msql.dll
extension=php_mssql.dll
extension=php_mysql.dll
extension=php_mysqli.dll
;extension=php_oci8.dll
;extension=php_openssl.dll
;extension=php_pdo.dll
;extension=php_pdo_firebird.dll
;extension=php_pdo_mssql.dll
;extension=php_pdo_mysql.dll
;extension=php_pdo_oci.dll
;extension=php_pdo_oci8.dll
;extension=php_pdo_odbc.dll
;extension=php_pdo_pgsql.dll
;extension=php_pdo_sqlite.dll
;extension=php_pgsql.dll
;extension=php_pspell.dll
;extension=php_shmop.dll
;extension=php_snmp.dll
;extension=php_soap.dll
;extension=php_sockets.dll
;extension=php_sqlite.dll
;extension=php_sybase_ct.dll
;extension=php_tidy.dll
;extension=php_xmlrpc.dll
;extension=php_xsl.dll
;extension=php_zip.dll
执行的时候出现:
Fatal error: Call to undefined function mysqli_connect() in C:\Program Files\Apache Group\Apache2\www\connectMysql.php on line 2
请高手帮忙看看为什么连不上数据库?
libmysql.dll这个已经复制,也不行,
@ $conn = new mysqli("localhost", "root", "1984", "MySQLDB"); 这个也已试过 也是不行
现在出现这个错误:
Fatal error: Class 'mysqli_connect' not found in C:\Program Files\Apache Group\Apache2\www\connectMysql.php on line 2
我的PHP是直接解压缩的。 展开
4个回答
展开全部
要把PHP文件夹下面的以下文件拷贝到C:\WINDOWS文件夹里面:
libmysql.dll
libmysql.dll
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
试试这句
@ $conn = new mysqli("localhost", "root", "1984", "MySQLDB");
@ $conn = new mysqli("localhost", "root", "1984", "MySQLDB");
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询