View Full Version : mysqli extension in php5

July 30th, 2011, 07:08 AM
I'm using an Asus EEE 1215B running Ubuntu 11.x (Natty Narwhal) with apache2, mysql and php5.3.5.

I got the following error:

Fatal error: Class 'mysqli' not found in /public_html/DocCon/DocConPHP/db_fns.php on line 22
I installed php5 and mysql using the apt-get command. Should I go back and rebuild it from the source? Total newbie here...

I have another box running Ubuntu 10.x and can do what I need to do without any problems. Any ideas on how to fix this? I suppose worst case I can just go back and reinstall Ubuntu 10.x...

July 30th, 2011, 12:23 PM
How did you install LAMP?

IndyTim / DataMan

July 30th, 2011, 03:41 PM
Sorry -- what do you mean by LAMP? I'm a total newbie when it comes to Linux (well, I've used it before but never actually configured my environment)...

July 30th, 2011, 04:00 PM
LAMP is an acronym for Linux Apache MySQL PHPH, basically he's asking how you installed Apache, MySQL and PHP.

July 30th, 2011, 04:25 PM
Probably this will help:

sudo apt-get install php5-mysql

This package contains the PHP module that interfaces with the MySQL server.

July 30th, 2011, 05:33 PM
Uncomment the mysqli extension in php.ini.

July 31st, 2011, 04:32 AM
Uncomment the mysqli extension in php.ini.

I uncommented this line: "mysqli.allow_local_infile = On" and it worked. That line was the only one commented in the php.ini file.

Indytim, I used apt-get install to install (as root, of course) all the packages, including php5-mysql.

July 24th, 2012, 05:59 PM
@allan_ong's solution worked for me as well. funny, before i switched to ubuntu i'd never even noticed that line before, and i do this stuff for a living... o_0

p.s. @allan_ong: you might want to mark this thread [SOLVED] ;)

September 23rd, 2012, 10:02 AM
Thanks allan_ong (http://ubuntuforums.org/member.php?u=1378819)