关于没有开启mbstring,mb_substr() 用不了的问题

2017-01-08 17:15:24

很多空间商默认没有开启mbstring,我们可以按如下方法进行添加:

[root@sns wxj]# yum install php-mbstring
Loading "installonlyn" plugin
Loading "rhnplugin" plugin
This system is not registered with RHN.
RHN support will be disabled.
Setting up Install Process
Setting up repositories
utterramblings 100% |=========================| 951 B 00:00
update 100% |=========================| 1.9 kB 00:00
base 100% |=========================| 1.1 kB 00:00
addons 100% |=========================| 951 B 00:00
extras 100% |=========================| 2.1 kB 00:00
Reading repository metadata in from local files
Parsing package install arguments
Resolving Dependencies
--> Populating transaction set with selected packages. Please wait.
---> Downloading header for
php-mbstring to pack into transaction set.
PHP-mbstring-5.2.17-jason 100% |=========================| 15 kB 00:00
---> Package php-mbstring.i386 0:5.2.17-jason.2 set to be updated
--> Running transaction check

Dependencies Resolved

=============================================================================
Package Arch Version Repository Size
=============================================================================
Installing:
php-mbstring i386 5.2.17-jason.2 utterramblings 1.3 M

Transaction Summary
=============================================================================
Install 1 Package(s)
Update 0 Package(s)
Remove 0 Package(s)

Total download size: 1.3 M
Is this ok [y/N]: y
Downloading Packages:
(1/1): php-mbstring-5.2.1 100% |=========================| 1.3 MB 00:04
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing: php-mbstring ######################### [1/1]

Installed: php-mbstring.i386 0:5.2.17-jason.2
Complete!

2.修改php.ini,添加一句extension=mbstring.so

 

发表评论:

Powered by PHP 学习者(mail:517730729@qq.com)

原百度博客:http://hi.baidu.com/ssfnadn

备案号:闽ICP备17000564号-1

开源中国 PHPCHINA