数据库驱动程序MySQLi错误

4 php mysql database mysqli

我正在使用PHP 5.2.10和MySQL 5.1.36-Community的Window Vista上运行Moodle测试环境.当我从Moodle 1.9.9升级到2.0时,我收到以下错误.

Error: database driver problem detected

The site administrator should verify server configuration

PHP has not been properly configured with the MySQLi extension so that it can communicate with MySQL. Please check your php.ini file or recompile PHP. MySQLi extension is not available for PHP 4.
Run Code Online (Sandbox Code Playgroud)

我还尝试在config.ini中更改dbtype ='mysqli',但仍然看到相同的错误.

如果您能提供一些解决此错误的建议,我将不胜感激.

先感谢您.

Ivo*_*Ivo 6

我前段时间也遇到了这个错误,我花了很长时间才弄清楚如何解决这个问题.基本上你需要做的就是为你的php envoirment添加一个扩展.以下解决方案适用于运行Apache和MySQL的Microsoft Windows Server 2003:

  • 找出运行moodle的服务器上php文件夹的位置.它通常在c:\ php.

  • 打开php.ini.在你会找到的文件中; extension = php_mysqli.dll.删除分号.

  • 保存文件.

  • 重启Apache并转到Moodle网站.

我们走了,你说从现在开始就好了;)希望这有帮助!!

  • 对于遇到此问题的任何其他人:请务必检查php.ini配置文件中的扩展目录设置.它可能默认设置为"ext",我不得不将其更改为完整路径"c:\ php\ext"并重新启动Apache以使其工作. (4认同)