Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to enable mbstring from php.ini? [closed]

I have real difficulties with enabling mbstring extension on my localhost.

I'm using XAMPP 1.7.4, for Windows, which has PHP 5.3.5, and tried to edit my php.ini file according to the documentation and various other examples I found online. After about 6 hours of this, all I managed to do is get a "Error 500 - Server error' message, that didn't go away even after I rolled-back all changes to the .ini file.

What I need to do, is create PDF invoices with Danish characters, using tFPDF, to support UTF-8 encoding.

If anybody here knows some tips, suggestions, or an example of a working php.ini setup, please help out, 'cause I'm starting to lose my hair over this one! :|

Thanks a lot!

like image 930
radu_m Avatar asked Jul 12 '11 01:07

radu_m


People also ask

How can I tell if Mbstring is enabled?

You can check it through phpinfo(). Search for the string "mbstring" in phpinfo page. If it is present means then mbstring is enabled or it is disabled.

What is Mbstring PHP extension?

Mbstring is an extension of php used to manage non-ASCII strings. Mbstring is used to convert strings to different encodings. Multibyte character encoding schemes are used to express more than 256 characters in the regular byte wise coding system.


1 Answers

All XAMPP packages come with Multibyte String (php_mbstring.dll) extension installed.

If you have accidentally removed DLL file from php/ext folder, just add it back (get the copy from XAMPP zip archive - its downloadable).

If you have deleted the accompanying INI configuration line from php.ini file, add it back as well:

extension=php_mbstring.dll

Also, ensure to restart your webserver (Apache) using XAMPP control panel.

Additional Info on Enabling PHP Extensions

  • install extension (e.g. put php_mbstring.dll into /XAMPP/php/ext directory)
  • in php.ini, ensure extension directory specified (e.g. extension_dir = "ext")
  • ensure correct build of DLL file (e.g. 32bit thread-safe VC9 only works with DLL files built using exact same tools and configuration: 32bit thread-safe VC9)
  • ensure PHP API versions match (If not, once you restart the webserver you will receive related error.)
like image 110
Shahriyar Imanov Avatar answered Oct 29 '22 01:10

Shahriyar Imanov