PHP 7.2.1, Uncaught Error: Class 'mysqli' not found [duplicate]

╄→尐↘猪︶ㄣ 提交于 2020-05-09 06:56:25

问题


in the first place it seems like I do not have mysqli installed, after running this if:

if (!function_exists('mysqli_init') && !extension_loaded('mysqli')) {
    echo 'We don\'t have mysqli!!!';
} else {
    echo 'Phew we have it!';
}

It returned the "we don't have mysqli!!!".

So after looking on how to install this I couldn't really find a way, after visiting http://php.net/manual/en/mysqli.installation.php, I scrolled down to find the "PHP 5.3.0 and newer" section where it says I wouldn't need to worry about installing it. So what should I do, and if there's a command I should run where should I run it? I'm using XAMPP to run php in case that matters.

Thanks in advance!

Edit: "extension=mysqli" is enabled in php.ini

Edit2: I'm on windows 10.


回答1:


If your on linux install mysql php extension

sudo apt-get install php7.2-mysql


来源:https://stackoverflow.com/questions/49109173/php-7-2-1-uncaught-error-class-mysqli-not-found

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!