Php 编写器安装-需要ext mbstring

Php 编写器安装-需要ext mbstring,php,apache,composer-php,cpanel,mbstring,Php,Apache,Composer Php,Cpanel,Mbstring,我正在尝试执行composer安装…,但出现错误需要ext mbstring*->您的系统中缺少请求的PHP扩展mbstring。我使用的是Apache(Cpanel)和PHP5.6 下面是我试图修复错误的方法 1:yum搜索mbstring ============================================= N/S matched: mbstring ============================================= ea-php54-php-m

我正在尝试执行
composer安装…
,但出现
错误需要ext mbstring*->您的系统中缺少请求的PHP扩展mbstring。
我使用的是Apache(Cpanel)和PHP5.6

下面是我试图修复错误的方法

1:
yum搜索mbstring

============================================= N/S matched: mbstring =============================================
ea-php54-php-mbstring.x86_64 : A module for PHP applications which need multi-byte string handling
ea-php55-php-mbstring.x86_64 : A module for PHP applications which need multi-byte string handling
ea-php56-php-mbstring.x86_64 : A module for PHP applications which need multi-byte string handling
ea-php70-php-mbstring.x86_64 : A module for PHP applications which need multi-byte string handling
ea-php71-php-mbstring.x86_64 : A module for PHP applications which need multi-byte string handling
ea-php72-php-mbstring.x86_64 : A module for PHP applications which need multi-byte string handling
rh-php56-php-mbstring.x86_64 : A module for PHP applications which need multi-byte string handling
rh-php70-php-mbstring.x86_64 : A module for PHP applications which need multi-byte string handling
rh-php71-php-mbstring.x86_64 : A module for PHP applications which need multi-byte string handling
2:
yum安装ea-php56-php-mbstring.x86_64

Loaded plugins: fastestmirror, universal-hooks
Loading mirror speeds from cached hostfile
 * EA4: 110.4.45.120
 * cpanel-addons-production-feed: 110.4.45.120
 * base: ftp.cuhk.edu.hk
 * centosplus: ftp.cuhk.edu.hk
 * epel: ftp.cuhk.edu.hk
 * extras: ftp.cuhk.edu.hk
 * ius: hkg.mirror.rackspace.com
 * updates: ftp.cuhk.edu.hk
Package ea-php56-php-mbstring-5.6.35-1.1.5.cpanel.x86_64 already installed and latest version
Nothing to do
似乎已安装mbstring,但为什么在尝试安装composer时出错

另一种方法(在cPanel中更新PHP版本)

1:WHM-已设置为7.1

2:cPanel-已设置为7.1

但服务器中的版本仍然是5.6


任何解决
需要ext-mbstring
错误的建议?

使用此命令安装mbstrig

 yum install php-mbstring
安装后重新启动apache

 service httpd restart

安装rh可以解决此问题
yum安装rh-php56-php-mbstring.x86_64

Loaded plugins: fastestmirror, universal-hooks
Loading mirror speeds from cached hostfile
 * EA4: 110.4.45.120
 * cpanel-addons-production-feed: 110.4.45.120
 * base: ftp.cuhk.edu.hk
 * centosplus: ftp.cuhk.edu.hk
 * epel: ftp.cuhk.edu.hk
 * extras: ftp.cuhk.edu.hk
 * ius: hkg.mirror.rackspace.com
 * updates: ftp.cuhk.edu.hk
Package ea-php56-php-mbstring-5.6.35-1.1.5.cpanel.x86_64 already installed and latest version
Nothing to do

请仔细检查服务器中的内容。我的是
rh-php56-php-mbstring.x86_64
不是
php-mbstring

试着用智能安装mbstring php库

============================================= N/S matched: mbstring =============================================
ea-php54-php-mbstring.x86_64 : A module for PHP applications which need multi-byte string handling
ea-php55-php-mbstring.x86_64 : A module for PHP applications which need multi-byte string handling
ea-php56-php-mbstring.x86_64 : A module for PHP applications which need multi-byte string handling
ea-php70-php-mbstring.x86_64 : A module for PHP applications which need multi-byte string handling
ea-php71-php-mbstring.x86_64 : A module for PHP applications which need multi-byte string handling
ea-php72-php-mbstring.x86_64 : A module for PHP applications which need multi-byte string handling
rh-php56-php-mbstring.x86_64 : A module for PHP applications which need multi-byte string handling
rh-php70-php-mbstring.x86_64 : A module for PHP applications which need multi-byte string handling
rh-php71-php-mbstring.x86_64 : A module for PHP applications which need multi-byte string handling
sudo apt-get install php-mbstring php7.1-mbstring

如果没有更深层次的依赖关系,可以使用polyfill替代:编辑composer.json并将问题行替换为
“symfony/polyfill mbstring”:“~1.0”


我最近在尝试运行PHP WordPress站点的构建时遇到了类似的问题。最后,我在
require
部分用下面的代码片段更新了
composer.json

# composer.json
# ...

"require": {
  "ext-mbstring": "*", # <-- I've added this
  "ext-gd": "*",
  "php": "7.*",
  "wordpress/wordpress": "*",

  # ...

}
#composer.json
# ...
“要求”:{

“ext mbstring”:“*”,#
没有可用的php mbstring包。
重新启动apache与Composer没有连接,因为Composer不使用apache。你们一定有一些心理问题…每次安装扩展时,你们都必须重新启动apache。无论被问到与否,你们每次都必须重新启动。现在,因为apache重新启动而给出否定的提示只是幼稚的,没有必要n sense.如果我在使用NGinx怎么办?仍然必须重新启动Apache?问题是用户正在运行Apache。
php-m
产生了什么?这里列出了
mbstring
?如果没有,你应该启用php扩展可能的重复项。包名不同。因此,这篇文章可能有助于提醒其他人仔细检查什么他们的服务器中有一个包,请为下一个人发布包名;)