Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mysqli not installed?

Tags:

php

debian

mysqli

I get the following error: Fatal error: Class 'mysqli' not found in my php script I have php5.3.3-7 installed and I get this when I run apt-cache show php5-mysql

Description: MySQL module for php5
 This package provides modules for MySQL database connections directly from
 PHP scripts.  It includes the generic "mysql" module which can be used
 to connect to all versions of MySQL, an improved "mysqli" module for
 MySQL version 4.1 or later, and the pdo_mysql module for use with
 the PHP Data Object extension.

There is nothing about mysql at all in php info. How do I find the extention and do I have to istall it? There are many references to mysqli in my php.ini. But something is wrong.

like image 521
mike628 Avatar asked Jul 17 '11 12:07

mike628


People also ask

Is MySQLi extension installed?

Check if MySQLi is Installed You can do that by visiting a phpinfo() page that you made, or by running this command: php -m | grep mysqli.

How do I download MySQLi?

Installing MySQL on Windows Simply download the installer package, unzip it anywhere, and run setup.exe. Default installer setup.exe will walk you through the trivial process and by default will install everything under C:\mysql.

Is MySQLi included in PHP?

The MySQLi extension was introduced with PHP version 5.0. 0. The MySQL Native Driver was included in PHP version 5.3.

Is MySQLi deprecated in PHP 7?

The oldest one uses the MySQL extension, which was deprecated as of PHP 5.5 and fully removed in PHP 7. The mysql() function no longer works in PHP 7.


2 Answers

Have you actually installed the php5-mysql package? apt-cache show will give you information on packages that aren't installed (you want dpkg -l to list installed packages). If the package is installed, double-check that it's enabled (/etc/php5/conf.d/mysql.ini is the place to look).

like image 172
womble Avatar answered Sep 22 '22 19:09

womble


Sounds like you just need to install MySQLi.

If you think you've done that and still have a problem, please post your operating system and anything else that might help

like image 37
genesis Avatar answered Sep 26 '22 19:09

genesis