【发布时间】:2018-10-03 07:01:52
【问题描述】:
我正在尝试执行 composer install ...,但收到错误 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system. 我正在使用 Apache (Cpanel) 和 PHP 5.6。
以下是我尝试修复错误的方法。
1:yum search 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 install 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
有解决require ext-mbstring错误的建议吗?
【问题讨论】:
-
php -m产生了什么?mbstring是否在其中列出?如果没有,您应该启用该 PHP 扩展 -
已解决。包名不同。因此,这篇文章可能会提醒其他人仔细检查他们在服务器中的内容
-
请把包名贴给下一个人;)
标签: php apache composer-php cpanel mbstring