2

Running a script in CLI I receive this error:

PHP Fatal error:  Call to undefined function mb_detect_encoding() <script path/name here>

Some background.

PHP 5.3.10 (cli) (built: Feb  2 2012 20:27:51)

Running Windows 7 (call it a work constraint) with MySQL and Apache2.2 (both currently functional)

I understand this function is part of the module php_mbstring.dll

I will attempt an exhaustive list of efforts to get this loaded:

  • Verified php.ini location; phpinfo indicates the loaded file is in c:\php; the configuration file is in c:\windows (two locations - both have an identical .ini file)
  • The php.ini files have uncommented extension=php_mbstring.dll
  • The extension directory is specified in both php.ini files as extension_dir = "c:\php\ext"
  • the specified file (php_mbstring.dll) is in fact present in the specified directory c:\php\ext\php_mbstring.dll
  • Although I cannot see why this would be effective, I have moved the dll to both the php root as well as windows32 directories as seen on other forums
  • I do have other functional non-core modules (e.g. mysqli) loaded in the same way without issue

It may be worth noting that upon uncommenting the extension line in the loaded config file (c:\php\php.ini), an additional system error of "can't start because php5.dll is missing from your computer" appears as a dialogue box. I have tried uncommenting in both and in either one and get the same error.

I suspect there is a way to load this module without recompiling or reinstalling PHP.

vincent
  • 1,305
  • 2
  • 12
  • 16
  • How did you install PHP? Probably DLL file is compiled for another version of PHP (I had this problem once)? – galymzhan Apr 29 '12 at 18:39

1 Answers1

0

Very late reply that might help others who find this question: If you are using the php built in development server it may be as simple as just restarting it so the edits to php.ini that enable mbstring are picked up.

HowardT
  • 1
  • 1
  • This does not provide an answer to the question. Once you have sufficient [reputation](https://stackoverflow.com/help/whats-reputation) you will be able to [comment on any post](https://stackoverflow.com/help/privileges/comment); instead, [provide answers that don't require clarification from the asker](https://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-can-i-do-instead). - [From Review](/review/late-answers/34678582) – Amolgorithm Jul 17 '23 at 05:43