Friday, April 15, 2022

[SOLVED] Can't get mbstring to work on Amazon linux 2 AMI

Issue

I run on Amazon linux 2 AMI, With PHP 7.2.5 and apache

The probleme is: Call to undefined function mb_convert_encoding

The initial need is to be able to read an uploaded text file correctly and have its content inserted in DB, knowing that the encodings can be various

The problem i am struggling with is to get mb_convert_encoding working !

i tried:

sudo yum install php-mbstring
sudo yum install php7.2-mbstring

and all the possible variations and php versions, with a sudo service httpd restart between each attempt, nothing get the function to work.

Any suggestion ? Thanks a lot


Solution

I had the same issue, strangely when I reboot the instances it did enabled.

First installed mbstring using this command:

sudo yum install php-mbstring

Then reboot

sudo shutdown -r now

I don't know why restarting httpd not enough, but its work for me, hopefully will work for you.



Answered By - Mansour
Answer Checked By - Gilberto Lyons (WPSolving Admin)