PHP Error: “Call to undefined function mysqli_conn

2019-05-02 05:43发布

In PHP I'm getting this error:

Call to undefined function mysqli_connect()

I checked my php.ini file and there is no ; in front of extension=php_mysql.dll or extension=php_mysqli.dll.

I think the I am getting this error because my figuration File (php.ini) Path is C:\Windows. How would I change it to C:\Apache2.2\php\php.ini?

3条回答
ら.Afraid
2楼-- · 2019-05-02 06:20

You can set the path using PHPIniDir in .htaccess or your server config.

ie.

PHPIniDir "C:/Apache2.2/php"

You won't have to recompile PHP if the extension gets loaded correctly (so make sure your extension_dir is correct), just make sure you restart Apache after you made these changes.

查看更多
狗以群分
3楼-- · 2019-05-02 06:21

You need to recompile PHP with the extension for this library.

查看更多
萌系小妹纸
4楼-- · 2019-05-02 06:27

On Ubuntu machines you can try:

sudo apt-get install php5-mysql

since the basic PHP5 install does not include the mysqli_connect function.

查看更多
登录 后发表回答