简体   繁体   English

如何找出mysqli扩展的问题?

[英]How can I find out what's wrong with mysqli extension?

I'm using PHP 5.6.30 and I need mysqli extension. 我正在使用PHP 5.6.30 ,我需要mysqli扩展。 In php.ini I have php.ini我有

extension_dir = "ext"
...
extension=php_mysqli.dll

ext dir exists in folder where php is installed, and php_mysqli.dll exists in either ext folder and in php install folder. ext dir存在于安装php的文件夹中,而php_mysqli.dll存在于ext文件夹和php install文件夹中。 php -m shows that mysqli is installed. php -m显示已安装mysqli。 Still the following code 还是下面的代码

new mysqli ( 'localhost', 'root', 'root', 'db_name_here');

outputs Fatal error: Class 'mysqli' not found 输出Fatal error: Class 'mysqli' not found

The question is: how can I find out what's wrong with mysqli 问题是:我如何找出mysqli

UPD. UPD。 I'm using Win7 and the server is Apache 2.4 我正在使用Win7 ,服务器是Apache 2.4

You can also check if the library is loaded or not in your env 您还可以检查是否在环境中加载了库

  if (extension_loaded('mysqli') && function_exists('mysqli_init')) {
   echo "having lib";
  }else{
  echo "No library loaded or exist";
  }

Also you can specify fully qualified path for extension_dir. 您也可以为extension_dir指定标准路径。

Check your extension_dir path. 检查您的extension_dir路径。 It should be fully qualified. 它应该完全合格。 ie

   extension_dir = "C:/wamp/php/ext" // your php path folder.

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM