问题描述
访问php网页后台报错:
[17-May-2019 01:24:02 UTC] PHP Fatal error: Uncaught Error: Call to undefined function mb_strimwidth() in /opt/wordpress/wp-content/themes/blog/header.php:9
解决办法
需要安装php-mbstring包,以下是centos7的基于php7.3的安装方法:
1、安装yum 配置包
#rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
#yum search php-mbstring
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* remi-safe: ap.stykers.moe
======================================================================================= N/S matched: php-mbstring ========================================================================================
php-mbstring.x86_64 : A module for PHP applications which need multi-byte string handling
php54-php-mbstring.x86_64 : A module for PHP applications which need multi-byte string handling
php55-php-mbstring.x86_64 : A module for PHP applications which need multi-byte string handling
php56-php-mbstring.x86_64 : A module for PHP applications which need multi-byte string handling
php70-php-mbstring.x86_64 : A module for PHP applications which need multi-byte string handling
php71-php-mbstring.x86_64 : A module for PHP applications which need multi-byte string handling
php72-php-mbstring.x86_64 : A module for PHP applications which need multi-byte string handling
php73-php-mbstring.x86_64 : A module for PHP applications which need multi-byte string handling
2、安装相关的包
# yum install php73-php-mbstring.x86_64
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* remi-safe: ap.stykers.moe
Resolving Dependencies
--> Running transaction check
---> Package php73-php-mbstring.x86_64 0:7.3.5-1.el7.remi will be installed
--> Processing Dependency: libonig.so.5()(64bit) for package: php73-php-mbstring-7.3.5-1.el7.remi.x86_64
--> Running transaction check
---> Package oniguruma5.x86_64 0:6.9.2-1.el7.remi will be installed
--> Finished Dependency Resolution
Dependencies Resolved
==========================================================================================================================================================================================================
Package Arch Version Repository Size
==========================================================================================================================================================================================================
Installing:
php73-php-mbstring x86_64 7.3.5-1.el7.remi remi-safe 473 k
Installing for dependencies:
oniguruma5 x86_64 6.9.2-1.el7.remi remi-safe 192 k
Transaction Summary
==========================================================================================================================================================================================================
Install 1 Package (+1 Dependent package)
Total download size: 665 k
Installed size: 1.7 M
Is this ok [y/d/N]: y
Downloading packages:
(1/2): oniguruma5-6.9.2-1.el7.remi.x86_64.rpm | 192 kB 00:00:00
(2/2): php73-php-mbstring-7.3.5-1.el7.remi.x86_64.rpm | 473 kB 00:00:00
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 2.2 MB/s | 665 kB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : oniguruma5-6.9.2-1.el7.remi.x86_64 1/2
Installing : php73-php-mbstring-7.3.5-1.el7.remi.x86_64 2/2
Verifying : php73-php-mbstring-7.3.5-1.el7.remi.x86_64 1/2
Verifying : oniguruma5-6.9.2-1.el7.remi.x86_64 2/2
Installed:
php73-php-mbstring.x86_64 0:7.3.5-1.el7.remi
Dependency Installed:
oniguruma5.x86_64 0:6.9.2-1.el7.remi
Complete!
3、检查应用恢复
原文链接:HP Fatal error: Uncaught Error: Call to undefined function mb_strimwidth(),转载请注明来源!