Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Composer error while installing Laravel: 'mbstring' is missing?

I've decided to try out Laravel and I've been going on and off with the installation because of how tedious it is in comparison to OOP PHP.

Nontheless I'm trying to execute the 'composer create-project laravel/laravel --prefer-dist' command on my cmd(.~/wamp/www/) and it created the Laravel folder but gives me this output:

*Installing laravel/laravel (v5.1.4)
  - Installing laravel/laravel (v5.1.4)
    Loading from cache

Created project in C:\wamp\www\laravel
> php -r "copy('.env.example', '.env');"
Loading composer repositories with package information
Installing dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - laravel/framework v5.1.8 requires ext-mbstring * -> the requested PHP exte
nsion mbstring is missing from your system.
    - laravel/framework v5.1.7 requires ext-mbstring * -> the requested PHP exte
nsion mbstring is missing from your system.
    - laravel/framework v5.1.6 requires ext-mbstring * -> the requested PHP exte
nsion mbstring is missing from your system.
    - laravel/framework v5.1.5 requires ext-mbstring * -> the requested PHP exte
nsion mbstring is missing from your system.
    - laravel/framework v5.1.4 requires ext-mbstring * -> the requested PHP exte
nsion mbstring is missing from your system.
    - laravel/framework v5.1.3 requires ext-mbstring * -> the requested PHP exte
nsion mbstring is missing from your system.
    - laravel/framework v5.1.2 requires ext-mbstring * -> the requested PHP exte
nsion mbstring is missing from your system.
    - laravel/framework v5.1.1 requires ext-mbstring * -> the requested PHP exte
nsion mbstring is missing from your system.
    - laravel/framework v5.1.0 requires ext-mbstring * -> the requested PHP exte
nsion mbstring is missing from your system.
    - Installation request for laravel/framework 5.1.* -> satisfiable by laravel
/framework[v5.1.0, v5.1.1, v5.1.2, v5.1.3, v5.1.4, v5.1.5, v5.1.6, v5.1.7, v5.1.
8].
C:\wamp\www>*

I am using windows.

I have tried installing a fresh composer, I have tried copying a laravel directory and placing it in my /www manually.

I've made sure that WAMP is using all modules and extensions according to what I read.

I've edited the php.ini file and taken of the semi-colons where necessary.

And now after a bit of Google Searching, I am lost.

Could anybody help me with this problem please, I would appreciate it.

Thanks in advance!

Below is my PHP.ini file

So I couldn't paste the whole thing, but take a look at it here:

http://jpst.it/AAhW

like image 792
Barry D. Avatar asked Nov 28 '22 01:11

Barry D.


2 Answers

I had the same problem. Here's the solution.

  1. Go to your php.ini file.
  2. Locate the extension "extension=php_mbstring.dll". (ctrl+f might not work, just locate the long list with extensions in php.ini)
  3. Uncomment the extension, you do this by removing the semicolon in the same line.
  4. Save your php.ini file.

This probably won't be the last time you'll encounter something like this. As a rule of thumb, read the error carefully and make the appropriate change to your php.ini file.

Good luck!

like image 182
Eltyer Avatar answered Nov 29 '22 15:11

Eltyer


Installing php-mbstring using,

sudo apt-get install php-mbstring

should fix this.

like image 27
Stranger Avatar answered Nov 29 '22 15:11

Stranger