K
K
Krivetka812018-04-03 14:05:08
linux
Krivetka81, 2018-04-03 14:05:08

Why doesn't composer see mbstring?

Good afternoon, when you try to install any framework or plugin through composer, you get errors like this:


$ composer create-project --prefer-dist yiisoft/yii2-app-basic .
Installing yiisoft/yii2-app-basic (2.0.14)
- Installing yiisoft/yii2-app-basic (2.0.14): Downloading (100%)
Created project in .
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
- yiisoft/yii2 2.0.15.1 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- yiisoft/yii2 2.0.15 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- yiisoft/yii2 2.0.14.2 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- yiisoft/yii2 2.0.14.1 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- yiisoft/yii2 2.0.14 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- Installation request for yiisoft/yii2 ~2.0.14 -> satisfiable by yiisoft/yii2[2.0.14, 2.0.14.1, 2.0.14.2, 2.0.15, 2.0.15.1].
To enable extensions, verify that they are enabled in your .ini files:
- /etc/php/7.1/cli/php.ini
- /etc/php/7.1/cli/conf.d/10-mysqlnd.ini
- /etc /php/7.1/cli/conf.d/10-opcache.ini
- /etc/php/7.1/cli/conf.d/10-pdo.ini
- /etc/php/7.1/cli/conf.d/15-xml.ini
- /etc/php/7.1/cli/conf.d/20-calendar.ini
- /etc/php/7.1/cli/conf. d/20-ctype.ini
- /etc/php/7.1/cli/conf.d/20-dom.ini
- /etc/php/7.1/cli/conf.d/20-exif.ini
- /etc/php /7.1/cli/conf.d/20-fileinfo.ini
- /etc/php/7.1/cli/conf.d/20-ftp.ini
- /etc/php/7.1/cli/conf.d/20-gd .ini
- /etc/php/7.1/cli/conf.d/20-gettext.ini
- /etc/php/7.1/cli/conf.d/20-iconv.ini
- /etc/php/7.1/cli/ conf.d/20-igbinary.ini
- /etc/php/7.1/cli/conf.d/20-imagick.ini
- /etc/php/7.1/cli/conf.d/20-intl.ini
- /etc /php/7.1/cli/conf.d/20-json.ini
- /etc/php/7.1/cli/conf.d/20-mysqli.ini
- /etc/php/7.1/cli/conf.d/20-pdo_mysql.ini
- /etc/php/7.1/cli/conf.d/20-phar.ini
- /etc/php/7.1/cli/conf. d/20-posix.ini
- /etc/php/7.1/cli/conf.d/20-readline.ini
- /etc/php/7.1/cli/conf.d/20-redis.ini
- /etc/php /7.1/cli/conf.d/20-shmop.ini
- /etc/php/7.1/cli/conf.d/20-simplexml.ini
- /etc/php/7.1/cli/conf.d/20-sockets .ini
- /etc/php/7.1/cli/conf.d/20-sysvmsg.ini
- /etc/php/7.1/cli/conf.d/20-sysvsem.ini
- /etc/php/7.1/cli/ conf.d/20-sysvshm.ini
- /etc/php/7.1/cli/conf.d/20-tokenizer.ini
- /etc/php/7.1/cli/conf.d/20-wddx.ini
- /etc /php/7.1/cli/conf.d/20-xmlreader.ini
- /etc/php/7.1/cli/conf.d/20-xmlwriter.ini
- /etc/php/7.1/cli/conf.d/20-xsl.ini
- /etc/php/7.1/cli/conf. d/20-zip.ini
- /etc/php/7.1/cli/conf.d/zzzz_custom.ini
You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.

The result of setting mbstring

$ sudo apt-get install php-mbstring
Reading package lists... Done
Building dependency tree
Reading state information... Done
php-mbstring is already the newest version (1:7.2+60+ubuntu16.04.1+deb.sury.org+1).
0 upgraded, 0 newly installed, 0 to remove and 104 not upgraded.
phpenmod mbstring result

WARNING: Module mbstring ini file doesn't exist under /etc/php/7.1/mods-available
WARNING: Module mbstring ini file doesn't exist under /etc/php/7.1/mods-available

Answer the question

In order to leave comments, you need to log in

3 answer(s)
T
tigra, 2018-04-03
@Krivetka81

sudo apt-get update
sudo apt-get install php7.1-mbstring

I
Ivan, 2018-04-03
@LiguidCool

phpinfo();
what does that say? It would be the first thing to watch.
Besides

WARNING: Module mbstring ini file doesn't exist under /etc/php/7.1/mods-available
WARNING: Module mbstring ini file doesn't exist under /etc/php/7.1/mods-available

It unambiguously hints to you that there is no config.

D
Dmitry Kim, 2018-04-03
@kimono

Tryphp7.0-mbstring

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question