0

I have mbstring installed on my Server and it shows in the "Additional .ini files parsed" line in the phpinfo() output. But when I try to use the mb_convert_encoding() function, it gives me the following error:

Fatal error: Uncaught Error: Call to undefined function mb_convert_encoding() in /var/www/example.org/public_html/debug.php:11 Stack trace: #0 {main} thrown in /var/www/example.org/public_html/debug.php on line 11

When I try to install mbstring with sudo apt-get install php7.2-mbstring it says that mbstring is already installed

Johannes
  • 377
  • 4
  • 17
  • There are two php.ini files, one for cli and one for apache. Ensure the extension is enabled in apache. – vascowhite May 01 '18 at 18:58
  • add e.g. `echo in_array('mbstring', get_loaded_extensions()) ? 'mbstring enabled' : 'mbstring missing';` to your debug.php to ensure it really is enabled/loaded where you need it. And check with `php_ini_loaded_file()` which php.ini is used. – nimmneun May 01 '18 at 21:41
  • It says mbstring is missing. The used ini file is `/etc/php/7.2/apache2/php.ini` but when I enable mbstring in this file and restart apache nothing happens – Johannes May 09 '18 at 11:41
  • I don't know why but I tried `sudo apt-get install php7.2-mbstring` again today and it worked. No idea why... – Johannes May 21 '18 at 01:06

0 Answers0