1

I'm working on a Laravel project which is hosted on a remote server. When I run the project I get following error:

vendor/laravel/framework/src/Illuminate/Support/Str.php line 160: Call to undefined function Illuminate\Support\mb_strimwidth()

So I contacted the server support and they told me the extension is enabled by default in php.ini:

extension=php_mbstring.dll

But I get the same error when I try to run the project so I have run some tests to find out what is happening.

$path = php_ini_loaded_file();
    echo 'The loaded file path is :' . $path;

if (extension_loaded('mbstring')) { 
    echo '<h1 style="color:red; font-size:50px;">extension is loaded<h1>';
}else {
    echo '<h1 style="color:red; font-size:50px;">extension is not loaded<h1>';
}

Output:

The loaded file path is :/usr/local/lib/php.ini

extension is not loaded

I have no access to SSH or any CLI interface so it is very hard to debug. I would like to know why this is happening. Help is appreciated.

Update

The support announced me that running phpinfo() does not return any entry for mbstring.

The php.ini file is loaded correctly with correct path.

Community
  • 1
  • 1
Janaka Dombawela
  • 1,337
  • 4
  • 26
  • 49

1 Answers1

2

Try Logging into your hosting Cpanel and from the Cpanel you have a option in it For PHP software version

Click on that & there you will have all the extensions that you can enable and disable.

Try giving this a shot

else use this code to check whether the extension is enabled or not:

<?php 
   echo "SW: ", extension_loaded('mb_strimwidth') ? 'OK' : 'MISSING', '<br>';
?>
Akshay Shrivastav
  • 1,115
  • 4
  • 17
  • 43