0

i am running a laravel project on a Puphpet VM set up (CentOS 6.4 Nginx) and all has been well but I created a new migration file and then went to run it [code]php artisan migrate[/code]

Then got the following error message:

  PHP Fatal error:  Call to undefined function Symfony\Component\Console\mb_detect_encoding() in /vagrant/vendor/symfony/console/Symfony/Component/Console/Application.php on line 721
  {"error":{"type":"Symfony\\Component\\Debug\\Exception\\FatalErrorException","message":"Call to undefined function Symfony\\Component\\Console\\mb_detect_encoding()","file":"\/vagrant\/vendor\/symfony\/console\/Symfony\/Component\/Console\/Application.php","line":721}}[/code]

Now looking around etc i see people refer to the mbstring needs to be installed etc but not sure how to go about this on a VM set up, and is this an update issue as i have managed ti run migration for a while on the VM but today nothing other than the error?

i have got access to the php.ini file and uncommented the following via Vim and set them both to pass, but nothing still even after a server restart.

 mbstring.http_input = pass
 mbstring.http_output = pass

Any advice appreciated.

As said i am using Puphpet/Vagrant using CentOS 6.4 with Nginx, on a MAC OSX 10.7 && 10.8 running PHP5.5

Simon Davies
  • 3,668
  • 9
  • 41
  • 69

2 Answers2

1

You should try to install mb_string, something like:

yum install php-mbstring

Then load the .so in your php configuration

William Vbl
  • 503
  • 3
  • 8
  • Thanks you will give this ago and feedback. – Simon Davies Nov 12 '13 at 15:22
  • With a little playing i had to first following the accepted answer here http://stackoverflow.com/questions/10278561/how-to-install-php-mbstring-on-centos-6-2 as got a No package php5-mbstring available. But then it still failed, so i changed your string to sudo yum install php-mbstring (without the 5) and it seemed to work no need to add the .so file. – Simon Davies Nov 12 '13 at 15:54
  • Ok I wasn't sure, I'm editing my answer then. Thanks for the feedback – William Vbl Nov 12 '13 at 17:22
0

I was facing the same error today. In my case the problem was that I had a separate php.ini for CLI, where the extension was not enabled.

After adding:

extension=php_mbstring.dll

to php_cli.ini everything worked fine.

Tamás Pap
  • 17,777
  • 15
  • 70
  • 102