How to resolve "Class 'MySQLi' not found" fatal error
P粉393030917
2023-08-21 17:33:55
<p>I was working on a tutorial and encountered this error:</p>
<blockquote>
<p>Fatal error: Class 'MySQLi' not found (long URL) at line 8</p>
</blockquote>
<p>The code on line 8 is: </p>
<pre class="brush:php;toolbar:false;">$mysqli = new MySQLi($db_server, $db_user, $db_pass, $db_name);</pre>
<p>I saw someone online saying to check whether it is turned on in phpinfo(), but there is nothing under "mysqli". </p>
<p>Also, I'm running PHP version 5.2.5</p>
You can check whether the mysqli library exists by executing the following code:
Sounds like you just need to install MySQLi.
If you think you've done this and are still having problems, please post your operating system and other information that may help with further diagnosis.