Laravel – Call to undefined function mb_strcut() – Solved

A few days ago I set up a new ubuntu system and installed PHP and composer. Then I was setup my old laravel application and tested it. Then send an email then I found “Call to undefined function mb_strcut()” issue with my application. I was thinking it will be because of laravel old version. Then I figure out what was the issue and how to resolve it.

I have the PHP 8.1 version and I need to install mbstring extension. I quickly check mbstring extension is there on my system or not by using the below command:

php -m | grep mbstring

Nothing found on above command then we need to install mbstring by following version vise solution:

Solution for PHP 8.1:

You need to install mbstring for php8.1 version.

sudo apt-get install php8.1-mbstring

Solution for PHP 8.0:

You need to install mbstring for php8.0 version.

sudo apt-get install php8.0-mbstring

Solution for PHP 7.4:

You need to install mbstring for php7.4 version.

sudo apt-get install php7.4-mbstring

Then, it was working for me.

I hope it can help you…

Leave a Comment