8

my error message that I am getting from the composer is: Your requirements could not be resolved to an installable set of packages.

 Problem 1
    - Installation request for laravel/framework v5.4.28 -> satisfiable by laravel/framework[v5.4.28].
    - laravel/framework v5.4.28 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
  Problem 2
    - Installation request for phpunit/phpunit 5.7.21 -> satisfiable by phpunit/phpunit[5.7.21].
    - phpunit/phpunit 5.7.21 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
  Problem 3
    - laravel/framework v5.4.28 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/tinker v1.0.1 requires illuminate/console ~5.1 -> satisfiable by laravel/framework[v5.4.28].
    - Installation request for laravel/tinker v1.0.1 -> satisfiable by laravel/tinker[v1.0.1].

I have tried uncommenting the extension=php_mbstring.dll but it still raises the error. I have tried to change the extension_dir in the "php.ini" and it gives an error. Help is appreciated.

Leo
  • 7,274
  • 5
  • 26
  • 48
Martin Savov
  • 118
  • 1
  • 1
  • 7
  • Had the same problem yesterday, solved it by installing it. But first you should specify which os you are running. For me it was centOS: `yum install php70w-mbstring` but for most common: https://stackoverflow.com/questions/34471633/cannot-initialize-mbstring-with-php-7 – online Thomas Jul 03 '17 at 17:24
  • Have you set the environment variable for php in your system? – Ruchita Sheth Jul 03 '17 at 17:27
  • I am using windows and I have tried to uncomment the extension=php_mbstring.dll unfortunately it does not work for some reason – Martin Savov Jul 03 '17 at 17:55
  • I have set in the environment variables the paths to ...\Composer\vendor\bin, ...\Git\cmd, ...\Git\bin, ...\ComposerSetup\bin – Martin Savov Jul 03 '17 at 17:58
  • I have tried most of the "stack overflow" pages, it doesn't solve my problem – Martin Savov Jul 03 '17 at 18:01
  • I have just added ...\PHP\vendor\composer, ...\PHP\ext to the environment variable and its brings the same error – Martin Savov Jul 03 '17 at 18:19
  • It isn't clear whether you're reporting a pure Laravel or Composer problem or the mbstring extension is actually not installed despite your efforts. Does it show up when you run `php -m`? – Álvaro González Jul 03 '17 at 18:27
  • it doesn't show this is the output bcmath calendar Core ctype date dom filter hash iconv json libxml mcrypt mysqlnd pcre PDO Phar readline Reflection session SimpleXML SPL standard tokenizer wddx xml xmlreader xmlwriter zip zlib – Martin Savov Jul 03 '17 at 18:28
  • Windows with `IIS`? `XAMPP`, `WAMP`, `MAMP` [other?](https://en.wikipedia.org/wiki/Comparison_of_web_server_software#Operating_system_support)? – online Thomas Jul 03 '17 at 18:32
  • XAMPP is what i am using – Martin Savov Jul 03 '17 at 18:44
  • which php version you are using? looks like you haven't set environment variable for PHP – Ruchita Sheth Jul 03 '17 at 18:46
  • 7.1.6 is my current php version in the command composer install and laravel new project_name i get the same error output as shown above PHP 7.1.6 (cli) (built: Jun 8 2017 01:53:41) ( ZTS MSVC14 (Visual C++ 2015) x64 ) Copyright (c) 1997-2017 The PHP Group Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies – Martin Savov Jul 03 '17 at 18:59

3 Answers3

15

-- EDIT BASED ON NEW INFORMATION --

Since this is Windows, re-installing PHP, enabling the extension in the PHP.INI file, and restarting the Webserver, should work.

-- PREVIOUS SOLUTION FOR LINUX --

You need to install mbstring for php.

Use:

 sudo apt-get install phpX.X-mbstring

Where X.X is your version number of PHP.

TBowman
  • 615
  • 4
  • 15
  • I am using windows with command prompt this is a Linux command which the cmd does not recognise – Martin Savov Jul 03 '17 at 17:49
  • OK, if you uncommented the extension, did you restart the webserver? – TBowman Jul 03 '17 at 18:23
  • I did, but on the php -m command I don't see the mbstring so, renstalling php and composer did not work – Martin Savov Jul 03 '17 at 18:58
  • Perhaps see this similar question: https://stackoverflow.com/questions/25414785/mbstring-missing-from-phpinfo-but-enabled-in-php-ini/25432880#25432880 – TBowman Jul 03 '17 at 19:03
  • update your solution so I can mark it as a correct one I had a conflict on the version on the php in the composer so I reinstalled it using the PHP downloaded from the site and it worked – Martin Savov Jul 03 '17 at 19:22
5

Its worked for me:

sudo apt-get install php7.2-mbstring
3

It works

sudo apt-get install php7.3-mbstring

sudo apt install php-xml

composer update