不从新编译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)

尝试过上述方法,感受费力不讨好。由于不很清楚的缘由,始终没有能编译成mbstring.so。最后仍是在pbone上找了个关于CentOS的php-mbstring的rpm包才安装成功。无论怎么说,rpm包仍是要比上述方法要好。php

相关文章
相关标签/搜索