Home >Backend Development >PHP Tutorial >Why Isn't My PHP Code Finding the MySQLi Class?
How to Resolve "Class 'MySQLi' Not Found" Error in PHP?
When attempting to execute a PHP script, you may encounter the following error:
Fatal error: Class 'MySQLi' not found (LONG URL) on line 8
This error typically arises when you attempt to establish a connection to a MySQL database using the MySQLi extension.
Cause:
The error occurs because the MySQLi extension is not enabled or installed on your system.
Solution:
To resolve this error, follow these steps:
extension=mysqli.so
Note for PHP 5.2.5:
PHP 5.2.5 does not support the MySQLi extension natively. You will need to install the PECL MySQLi extension specifically for PHP 5.2.5. Refer to the PECL documentation for installation instructions.
The above is the detailed content of Why Isn't My PHP Code Finding the MySQLi Class?. For more information, please follow other related articles on the PHP Chinese website!