“即使在成功安装apt-get之后,系统也缺少”请求的PHP扩展mbstring“

时间:2018-05-14 18:44:31

标签: php ubuntu phpunit composer-php

我正在尝试

  

$ composer require --dev phpunit / phpunit ^ 6.5

并收到以下错误:

 Problem 1
    - phpunit/phpunit 6.5.8 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.

所以我多次运行以下

  

$ sudo apt-get install php-mbstring

并获取

php-mbstring is already the newest version (1:7.2+60ubuntu1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
  

$ php --ini

给出:

Configuration File (php.ini) Path: /etc/php/7.0/cli
Loaded Configuration File:         /etc/php/7.0/cli/php.ini

我也没有提到过 extension=php_mbstring.dll  /etc/php/7.0/cli/php.ini 中的行(无关/错误操作)

我仍然收到“mbstring is missing from your system”错误。

我在Ubuntu 18.04上

修改 composer命令也给出:

PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/php_mbstring.dll' - /usr/lib/php/20151012/php_mbstring.dll: cannot open shared object file: No such file or directory in Unknown on line 0

是的,在ubuntu的php.ini中取消注释extension=php_mbstring.dll是错误的/不相关的(见评论)

0 个答案:

没有答案