3

I execute this on my centos/WHM server :

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

Result is: We don't have mysqli!!!

My problem is that:

Fatal error: Class 'mysqli' not found in /home/photosdr/public_html/includes/database.php on line 18

So how can I install it ? Thank you

Jean-Rémy Revy
  • 5,607
  • 3
  • 39
  • 65
ERC20
  • 61
  • 1
  • 1
  • 3
  • My probleme is that : Fatal error: Class 'mysqli' not found in /home/photosdr/public_html/includes/database.php on line 18 – ERC20 Jun 13 '12 at 23:06
  • $this->res = new mysqli( $conf[ 'dbhost' ], $conf[ 'dbuser' ], $conf[ 'dbpass' ], $conf[ 'dbname' ] ); – ERC20 Jun 13 '12 at 23:07
  • @mgraph: If that were the problem, nothing would appear in the page (unless you viewed the page source, in which case you'd see the raw PHP code). The problem is that the mysqli module isn't installed and/or enabled. – cHao Jun 13 '12 at 23:07
  • yes, how can i install mysqli extention , thats my question :) – ERC20 Jun 13 '12 at 23:08
  • If it's already there, then you might try adding `extension = php_mysqli.so` in your php.ini. Yum should have included it with your PHP, so if it didn't, you probably don't have a prepackaged PHP...and you'll have to rebuild it with the module enabled. – cHao Jun 13 '12 at 23:09
  • Check [here](http://php.net/manual/en/mysqli.installation.php) for instructions on enabling or installing mysqli – sachleen Jun 13 '12 at 23:10
  • i added extension = php_mysqli.so to php.ini, same issue . – ERC20 Jun 13 '12 at 23:11
  • Sachleen, i already follow the link you give me, butt didnt work. im nor expert in centos. – ERC20 Jun 13 '12 at 23:12
  • @YoussefEssaaf: Does your server have WHM/CPanel installed? – cHao Jun 13 '12 at 23:15
  • cHao, yes , i have WHM/Cpanel installed. im a root. – ERC20 Jun 13 '12 at 23:16
  • Go in there and look around. WHM likes to build its own PHP, and there should be a tool under "Software" labeled "EasyApache (Apache Update)". Click that and go through the steps...along the way you'll get to pick what modules PHP gets built with. Make sure to include mysqli. :) – cHao Jun 13 '12 at 23:18
  • @cHao , i found easyapache, and now i have 7 steps, wait, im triyng... – ERC20 Jun 13 '12 at 23:22
  • It'll take a while to build...maybe as much as 30-45 minutes once you're done configuring. So, no rush. :) – cHao Jun 13 '12 at 23:23

1 Answers1

5

Try finding extension=php_mysqli.so in your php.ini and remove comment in front of it.

Stan
  • 25,744
  • 53
  • 164
  • 242