不重新编译php,增加动态模块
以mbstring模块为例:
1 进入php源代码目录中的mbstring所在目录
cd /usr/local/src/php-5.2.4/ext/mbstring/
2 执行php安装后目录中的bin/phpize文件
/usr/local/php/bin/phpize
3 进入php源代码目录
cd /usr/local/src/php-5.2.4/
4 执行上述目录中的configure文件
./configure –prefix=/usr/local/src/php-5.2.4/ext/mbstring –with-php-config=/usr/local/php/bin/php-config
5 make; make install
将mbstring.so安装到/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/中
6 编辑php.ini,加入一行
extension=mbstring.so
7 重新启动httpd
service httpd restart(如果是php-cgi模式的,请先杀掉所有的php-cgi进程,再重启httpd)
没有发现 PHP 的扩展设置mbstring
操作环境:
Fedora Core 3
Apache/2.0.52 (built: Oct 15 2004 11:39:29 )
PHP 4.3.9 (cgi) ( built: Oct 20 2004 14:52:04 )
phpMyAdmin 2.6.4-pl3
今天打开phpMyAdmin突然出现如下红字警告:
linux PHP 的扩展设置mbstring, 而当前系统好像在使用宽字符集。没有 mbstring 扩展的 phpMyAdmin 不能正确识别字符串,可能产生不可意料的结果.
英文即是:The mbstring PHP extension was not found and you seem to be using multibyte charset. Without mbstring extension phpMyAdmin is unable to split strings correctly and it may result in unexpected results.
==================================================================
解决方法:安装 php-mbstring-4.3.9-3.i386.rpm 包,重启apache即
yum install php-mbstring
或重新编译安装php:
# ./configure –enable-mbstring