-1

Before this it works well. After i trying messed up upgrade to php5.6 then downgrade again to 5.5 the mysqli not working at my terminal.

It return error message .

"Fatal error: Class 'MySqli' not found"

I have try some of suggestion over stackoverflow but none of them working .

Thanks

ArK
  • 20,698
  • 67
  • 109
  • 136
Caal
  • 45
  • 7

1 Answers1

0

It seems you have to install MySqli

Here's the command you need.

 sudo apt-get install php5-mysqlnd

After installation don't forget to stop and start or restart Apache

Additional Note :

To check whether you have mysqli in your bundle or not you can try that with this code

if (!function_exists('mysqli_init') && !extension_loaded('mysqli')) {
    echo 'MySQLi, Not Installed';
} else {
    echo 'MySQLi Exists';
}
Sulthan Allaudeen
  • 11,330
  • 12
  • 48
  • 63
  • No, this one not working . Your answer same like other thread(http://stackoverflow.com/questions/666811/fatal-error-class-mysqli-not-found) but it not working . That script will always return MySQLi, Not Installed at terminal but MySQLi Exists at web browser . I already tried this . – Caal Apr 09 '15 at 04:02
  • Without `mysqli_init` i fear how it could be possible – Sulthan Allaudeen Apr 09 '15 at 04:03
  • Your terminal and your browser shows different output ?? !! – Sulthan Allaudeen Apr 09 '15 at 04:09
  • yes . that's why my question not working at terminal . – Caal Apr 09 '15 at 04:10
  • Can you please run it in terminal to see whether both refers same `php.ini` by using this `php -i |grep "php.ini"` in terminal and `echo php_info()` from browser ?? – Sulthan Allaudeen Apr 09 '15 at 04:12
  • Can you able to notice different paths of `php.ini` loaded ? – Sulthan Allaudeen Apr 09 '15 at 04:19
  • I not sure because when i go to /usr/local/lib there no php.ini even inside php folder – Caal Apr 09 '15 at 04:22
  • Can you type this in terminal `find / -type f -name "php.ini"` to search all the php.ini in your machine ? – Sulthan Allaudeen Apr 09 '15 at 04:28
  • It return /etc/php5/apache2/php.ini /etc/php5/cli/php.ini both same still not working http://sitepreview.ourace.com/compareini.php?s=1&g=5526014488b1a5526014488b52 – Caal Apr 09 '15 at 04:34
  • By enabling the extension `extension=mysqlnd.so` in both files it doesn't means that it is installed. Do you enabled it manually or what ?? – Sulthan Allaudeen Apr 09 '15 at 04:51
  • I manage to fix this after remove php 5.3.xx . I tried to downgrade before . after complete remove follow this http://askubuntu.com/questions/569067/how-to-uninstall-both-packaged-and-manually-installed-versions-of-php it works again . – Caal Apr 09 '15 at 05:11
  • That's great to hear ! – Sulthan Allaudeen Apr 09 '15 at 06:39