2

So I'm trying to get phpmyadmin running on windows 7, and I've gone through and installed all the proper programs/files (apache, mySQL, php, etc..) and i have the phpmyadmin folder in the right place in my directory, such that when I try to access it in my browser when the directory index is set to index.html it shows the whole directory. However, when I switch the directory to index.php i'm getting this error:

Fatal error: Call to undefined function mb_detect_encoding() in C:\apache\htdocs\phpmyadmin\libraries\php-gettext\gettext.inc on line 177

I've looked at a few support pages and everything (such as this one) but all of the suggestions don't seem to be helping me out. Most of them talk about editing the php.ini file in the /php folder, but I don't even have that, I have a php.ini-development and php.ini-production file and thats it. Suggestions?? I have also tried reinstalling php to see if it was an issue with the installation...didn't work. Please help!

Community
  • 1
  • 1
Luminusss
  • 551
  • 1
  • 5
  • 26
  • 1
    Use phpinfo() to tell you which file php is using as its ini file – Mark Baker Mar 08 '14 at 15:35
  • What php version did you install? – Fabio Mar 08 '14 at 15:35
  • Possible duplicates: http://stackoverflow.com/questions/17204437/fatal-error-call-to-undefined-function-mb-detect-encoding – Krish R Mar 08 '14 at 15:37
  • version 5.5.10 i believe and @mark is that a command that can be run from the command line? I am new to all of this. – Luminusss Mar 08 '14 at 15:37
  • phpinfo() is a php function that will display the details of your php configuration, neatly formatted, when used in a script. From the command line, use `php -i | grep .ini` on Linux or Windows with a grep function. Note that your web and command line may have different ini files – Mark Baker Mar 08 '14 at 15:39
  • it won't even let me run a php command, its saying its not a valid command... – Luminusss Mar 08 '14 at 15:41
  • 1
    Either make sure php.exe is in your windows path, or run it from the php directory – Mark Baker Mar 08 '14 at 16:47
  • 1
    As Mark Baker said, some systems use different php.ini files for the command line PHP compared to the one called by the webserver, so I would run it as a webpage rather than from the command line. Make a new file in your webroot containing `` and loading that through your web browser is probably better than doing it on the command line. – Isaac Bennetch Mar 09 '14 at 23:11

2 Answers2

12

The issue was caused by some of the extensions being blocked and the extension directory not being fully set.

In the php.ini file extension_dir= needs to be set to "C:\php\ext" or whereever the php ext file is located. Also the following extensions need to be uncommented in the php.ini file as well

extension=php_gd2.dll extension=php_mbstring.dll extension=php_exif.dll extension=php_mysqli.dll

Another thing that helps is to go in to the php\ext folder, right click on each of the above exts and select unblock and make sure they are not set to read-only.

Luminusss
  • 551
  • 1
  • 5
  • 26
  • 1
    you saved my life...! I recommend everyone who encounters this problem on W7 to do *exactly* what you say here... including the explicit path to \ext (with backslashes). You "unblock" by right-clicking and going to the property tab. On a more general note, it's quite annoying when SO contributors assume poster are on a *nix box for a question like this: it's very often much more of a hassle getting stuff to work on the ghastly rubbish that is Windoze (my opinion), and it is quite unhelpful to pretend the entire world has now switched to Linux. – mike rodent Jul 24 '14 at 17:51
5

Rename the php.ini-development to php.ini and enable/add

extension=mysqli.dll
extension=mbstring.dll 

Do restart apache after this change

Akash
  • 4,738
  • 9
  • 38
  • 65
  • how to I add that into the file? is there any particular syntax? or can I just copy and paste as it ias – Luminusss Mar 08 '14 at 15:39
  • Just copy or replace. – ajtamwojtek Mar 08 '14 at 15:40
  • just anywhere in the file? do I need the ; before it as most of the other lines have it too? – Luminusss Mar 08 '14 at 15:43
  • If its already there in the file with the prefixing, `;`, removing `;`, it indicates a comment, which is ignored. Removing the prefixed comment `;` shall cause PHP to include it as one of the extensions – Akash Mar 08 '14 at 15:44
  • so I found this: `;extension=php_intl.dll ;extension=php_imap.dll ;extension=php_interbase.dll ;extension=php_ldap.dll extension=php_mbstring.dll ;extension=php_exif.dll ; Must be after mbstring as it depends on it ;extension=php_mysql.dll extension=php_mysqli.dll ;extension=php_oci8.dll ; Use with Oracle 10gR2 Instant Client ;extension=php_oci8_11g.dll ; Use with Oracle 11gR2 Instant Client ;extension=php_openssl.dll` and took out the ; on the lines you said, and it still doesn't work but those aren't the exact ones that you said – Luminusss Mar 08 '14 at 15:48
  • I also tried adding `extension=mysqli.dll extension=mbstring.dll ` To the end of that list and it is not working – Luminusss Mar 08 '14 at 15:55
  • did you re-start apache after adding it? – Akash Mar 08 '14 at 16:02
  • I was missing the actual mbstring package on CentOS 6 which can be installed with `yum install php-mbstring` – Banjer Nov 23 '14 at 14:47