Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

laravel/framework requires ext-mbstring

I am using Kali linux and I am having difficulty installing the laravel framework. I havelooked up in different links like this one and manyothers but nothing seems to work. For every this I do. It keeps bringing this error

laravel/framework v5.5.9 requires ext-mbstring -> ...
...

For instance:

root@iO-PC:/opt/lampp/htdocs/projects# composer create-project laravel/laravel Test "5.5.*"

On processing.. This is what shows up.

    Installing laravel/laravel (v5.5.28)
  - Installing laravel/laravel (v5.5.28): Loading from cache
Created project in Test
> @php -r "file_exists('.env') || copy('.env.example', '.env');"
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - laravel/framework v5.5.9 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.5.8 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.5.7 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.5.6 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.5.5 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.5.4 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.5.36 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.5.35 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.5.34 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.5.33 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.5.32 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.5.31 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.5.30 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.5.3 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.5.29 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.5.28 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.5.27 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.5.26 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.5.25 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.5.24 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.5.23 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.5.22 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.5.21 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.5.20 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.5.2 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.5.19 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.5.18 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.5.17 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.5.16 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.5.15 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.5.14 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.5.13 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.5.12 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.5.11 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.5.10 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.5.1 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.5.0 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - Installation request for laravel/framework 5.5.* -> satisfiable by laravel/framework[v5.5.0, v5.5.1, v5.5.10, v5.5.11, v5.5.12, v5.5.13, v5.5.14, v5.5.15, v5.5.16, v5.5.17, v5.5.18, v5.5.19, v5.5.2, v5.5.20, v5.5.21, v5.5.22, v5.5.23, v5.5.24, v5.5.25, v5.5.26, v5.5.27, v5.5.28, v5.5.29, v5.5.3, v5.5.30, v5.5.31, v5.5.32, v5.5.33, v5.5.34, v5.5.35, v5.5.36, v5.5.4, v5.5.5, v5.5.6, v5.5.7, v5.5.8, v5.5.9].

  To enable extensions, verify that they are enabled in your .ini files:
    - /etc/php/7.0/cli/php.ini
    - /etc/php/7.0/cli/conf.d/10-mysqlnd.ini
    - /etc/php/7.0/cli/conf.d/10-opcache.ini
    - /etc/php/7.0/cli/conf.d/10-pdo.ini
    - /etc/php/7.0/cli/conf.d/20-calendar.ini
    - /etc/php/7.0/cli/conf.d/20-ctype.ini
    - /etc/php/7.0/cli/conf.d/20-exif.ini
    - /etc/php/7.0/cli/conf.d/20-fileinfo.ini
    - /etc/php/7.0/cli/conf.d/20-ftp.ini
    - /etc/php/7.0/cli/conf.d/20-gettext.ini
    - /etc/php/7.0/cli/conf.d/20-iconv.ini
    - /etc/php/7.0/cli/conf.d/20-json.ini
    - /etc/php/7.0/cli/conf.d/20-mysqli.ini
    - /etc/php/7.0/cli/conf.d/20-pdo_mysql.ini
    - /etc/php/7.0/cli/conf.d/20-phar.ini
    - /etc/php/7.0/cli/conf.d/20-posix.ini
    - /etc/php/7.0/cli/conf.d/20-readline.ini
    - /etc/php/7.0/cli/conf.d/20-shmop.ini
    - /etc/php/7.0/cli/conf.d/20-sockets.ini
    - /etc/php/7.0/cli/conf.d/20-sysvmsg.ini
    - /etc/php/7.0/cli/conf.d/20-sysvsem.ini
    - /etc/php/7.0/cli/conf.d/20-sysvshm.ini
    - /etc/php/7.0/cli/conf.d/20-tokenizer.ini
    - /etc/php/7.0/cli/conf.d/20-zip.ini
  You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.

What do I have to fix this?

like image 600
Pyr James Avatar asked Mar 03 '18 18:03

Pyr James


3 Answers

Install the required mbstring extension

sudo apt-get install php-mbstring  

In Dockerfile you should add:

RUN docker-php-ext-install mbstring 
like image 147
Mahdi Younesi Avatar answered Sep 18 '22 12:09

Mahdi Younesi


sudo apt install php-mbstring will work and will download the plugin for the latest PHP version.

If your PHP version is not the latest, then you can add version in it:

# PHP 7.1 sudo apt install php7.1-mbstring  # PHP 7.2: sudo apt install php7.2-mbstring  # PHP 7.3 sudo apt install php7.3-mbstring  # PHP7.4 sudo apt install php-mbstring 
like image 36
Player1 Avatar answered Sep 19 '22 12:09

Player1


I have the same problem when installing Laravel 6 and getting an error like this

Installing laravel/laravel (v6.12.0)
  - Installing laravel/laravel (v6.12.0): Loading from cache
Created project in sistemLogin
> @php -r "file_exists('.env') || copy('.env.example', '.env');"
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - laravel/framework v6.9.0 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v6.8.0 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v6.7.0 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v6.6.2 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v6.6.1 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v6.6.0 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v6.5.2 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v6.5.1 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v6.5.0 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v6.4.1 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v6.4.0 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v6.3.0 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v6.2.0 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v6.17.1 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v6.17.0 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v6.16.0 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v6.15.1 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v6.15.0 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v6.14.0 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v6.13.1 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v6.13.0 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v6.12.0 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v6.11.0 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v6.10.1 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v6.10.0 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework 6.x-dev requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - Installation request for laravel/framework ^6.2 -> satisfiable by laravel/framework[6.x-dev, v6.10.0, v6.10.1, v6.11.0, v6.12.0, v6.13.0, v6.13.1, v6.14.0, v6.15.0, v6.15.1, v6.16.0, v6.17.0, v6.17.1, v6.2.0, v6.3.0, v6.4.0, v6.4.1, v6.5.0, v6.5.1, v6.5.2, v6.6.0, v6.6.1, v6.6.2, v6.7.0, v6.8.0, v6.9.0].

  To enable extensions, verify that they are enabled in your .ini files:
    - /etc/php/7.4/cli/php.ini
    - /etc/php/7.4/cli/conf.d/10-mysqlnd.ini
    - /etc/php/7.4/cli/conf.d/10-opcache.ini
    - /etc/php/7.4/cli/conf.d/10-pdo.ini
    - /etc/php/7.4/cli/conf.d/20-calendar.ini
    - /etc/php/7.4/cli/conf.d/20-ctype.ini
    - /etc/php/7.4/cli/conf.d/20-curl.ini
    - /etc/php/7.4/cli/conf.d/20-exif.ini
    - /etc/php/7.4/cli/conf.d/20-ffi.ini
    - /etc/php/7.4/cli/conf.d/20-fileinfo.ini
    - /etc/php/7.4/cli/conf.d/20-ftp.ini
    - /etc/php/7.4/cli/conf.d/20-gettext.ini
    - /etc/php/7.4/cli/conf.d/20-iconv.ini
    - /etc/php/7.4/cli/conf.d/20-json.ini
    - /etc/php/7.4/cli/conf.d/20-mysqli.ini
    - /etc/php/7.4/cli/conf.d/20-pdo_mysql.ini
    - /etc/php/7.4/cli/conf.d/20-phar.ini
    - /etc/php/7.4/cli/conf.d/20-posix.ini
    - /etc/php/7.4/cli/conf.d/20-readline.ini
    - /etc/php/7.4/cli/conf.d/20-shmop.ini
    - /etc/php/7.4/cli/conf.d/20-sockets.ini
    - /etc/php/7.4/cli/conf.d/20-sysvmsg.ini
    - /etc/php/7.4/cli/conf.d/20-sysvsem.ini
    - /etc/php/7.4/cli/conf.d/20-sysvshm.ini
    - /etc/php/7.4/cli/conf.d/20-tokenizer.ini
    - /etc/php/7.4/cli/conf.d/20-zip.ini
  You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.

And I try command:

sudo apt-get install php-mbstring 

After that I tried again install laravel and there were still problems like this

    Installing laravel/laravel (v6.12.0)
  - Installing laravel/laravel (v6.12.0): Loading from cache
Created project in sistemLogin
> @php -r "file_exists('.env') || copy('.env.example', '.env');"
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - phpunit/phpunit 8.5.x-dev requires ext-dom * -> the requested PHP extension dom is missing from your system.
    - phpunit/phpunit 8.5.2 requires ext-dom * -> the requested PHP extension dom is missing from your system.
    - phpunit/phpunit 8.5.1 requires ext-dom * -> the requested PHP extension dom is missing from your system.
    - phpunit/phpunit 8.5.0 requires ext-dom * -> the requested PHP extension dom is missing from your system.
    ...........

So if like that, you can try command

sudo apt-get update
sudo apt install php-xml

then run

composer update
composer require cviebrock/eloquent-sluggable

PHP7 : install ext-dom issue

like image 44
Ismynr Avatar answered Sep 17 '22 12:09

Ismynr