Search code examples
phpapachephpmyadminservermbstring

The mbstring extension not seen by phpMyAdmin


I know there has been a lot of questions about this, but they didn't helped me to solve my problem.

I get this error when trying to access phpMyAdmin:

phpMyAdmin - Error

The mbstring extension is missing. Please check your PHP configuration.

I am running php7.0 - in php.ini located in etc/php/7.0/apache2 I have this:

extension_dir = "./"
extension_dir = "mods-available"

uncomented. I've also tried

extension_dir = "./"
extension_dir = "ext"

but it didn't work and I don't have any "ext" directory in etc/php/7.0/ so it doesnt make any sense to have it there right? Anyway I tried both options and I tried restarting apache after setting either one of them, but nothing works.

Furthermore when running

sudo apt-get install php7.0-mbstring

I get output:

php7.0-mbstring is already the newest version (7.0.4-7ubuntu2.1).
php7.0-mbstring set to manually installed.

which means it's already installed right? If I ls the directory etc/php/7.0/mods-available I can see file called mbstring.ini which I suppose is the proof it's installed. But when trying to access phpMyAdmin it still says that mbstring is missing.

Any ideas?


Solution

  • Your question is all over the place so let me start from scratch:

    1. Run phpinfo(); from a test file and check out the extension_dir
    2. Does the extension_dir point to the right place? Yes, great! No, fix it.
    3. Does the extension exist in extension_dir? Yes, nice. No, add the extension.

    Also, why do you have:

    extension_dir = "./"
    extension_dir = "mods-available"
    

    Did you need this instead?

    extension_dir = "./mods-available"
    

    It might be worth trying a full path like I use on my Windows machine:

    extension_dir = "C:\\PHP\\x86\\7.0.2\\ext"