需要跟现有版本完全相同的php源码版本,我这里是php5.3.0 以安装mbstring模块为例
[root@localhost php-5.3.0]# cd ext/mbstring/
[root@localhost mbstring]# /usr/local/php5/bin/phpize 脚本文件,目的是搭建动态模块的环境,该命令一定要使用在php的模块文件夹主目录下,这里报错Cannot find
config.m4。因为phpize要根据模块生成模块的配置文件放在模块文件夹下面 [root@localhost
mbstring]# ./configure --with-php-config=/usr/local/php5/bin/php-config
注意:在没有在模块根文件夹下执行'/usr/local/php5/bin/phpize的话是没有configure配置文件的!配置如果不报错就继
续 [root@localhost mbstring]# make [root@localhost mbstring]# make install Installing shared extensions: /usr/local/php5/lib/php/extensions/no-debug-zts-20090626/ Installing header files: /usr/local/php5/include/php/ [root@localhost mbstring]# ll /usr/local/php5/lib/php/extensions/no-debug-zts-20090626/ total 2700 -rwxr-xr-x 1 root root 2760042 Aug 12 01:57 mbstring.so 此时我们发现mbstring.so已经copy到php默认的扩展文件夹里了,好了,马上要大功告成了,现在在php.ini里添加对mbstring.so的支持 [root@localhost mbstring]# vi /usr/local/php5/lib/php.ini 增加extension=mbstring.so,好了php设置完成,现在重启web就行了 [root@localhost mbstring]# /home/service/http/apache2/bin/apachectl restart 查看phpinfo可以看到支持mbstring了
|