2012年(25)
分类: LINUX
2012-08-03 14:53:03
1.
[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
方法2:我试过好用
Linux下mbstring安装
很多空间商默认没有开启mbstring,在不想重新编译整个php的情况下,我们可以单独编译mbstring
1、用cd命令进入php的源代码目录下的etc/mbstring目录下,如“/src/php5.2.5”,即“cd /src/php5.2.5”;
2、# /usr/local/php/bin/phpize (假设php安装在/usr/local/php目录下)
3、编译配置,# ./configure --with-php-config=/usr/local/php/bin/php-config
4、执行make && make install (事情上执行make编译就行了)
5、之后系统会提示你mbstring.so文件所在的目录。根据php.ini中指示的extension_dir指向的目录中,将其复制过去.或将
mbstring.so复制到/usr/local/php/ext目录下,在手配置参extension_dir="/usr/local/php
/ext"指向mbstring.so所在目录.
6、修改php.ini,添加一句extension=mbstring.so
7、然后重启apache:运行 /service httpd restart即可完成安装。