Home > Backend Development > PHP Tutorial > 不重新编译php,增加动态模块(以mbstring模块为例)

不重新编译php,增加动态模块(以mbstring模块为例)

WBOY
Release: 2016-06-23 13:43:43
Original
952 people have browsed it

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包还是要比上述方法要好。

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template