PHP代码:

$dbc = mysqli_connect('IP address:port', 'username', 'password', 'databasename')


运行时报:

Call to undefined function mysqli_connect()


解决方法:

PHP安装目录下,找到php.ini,去掉该文件中extension=php_mysqli.dll前的分号,再加上extension_dir="PHP安装目录/ext",复制PHP安装目录下/ext下对应的dll到C:\WINDOWS\system32目录下,重启apache。


重启apache:

cmd,net stop apache2.2, net start apache2.2