当前位置:实例文章 » PHP实例» [文章]通过源码包php-5.4.9.tar.gz编译安装PHP之后,如何加载动态模块,不需要重新配置PHP_PHP教程

通过源码包php-5.4.9.tar.gz编译安装PHP之后,如何加载动态模块,不需要重新配置PHP_PHP教程

发布人:shili8 发布时间:2022-12-09 23:18 阅读次数:91

首先确认:我们在安装PHP时,指定了它的安装目录:--prefix=/var/lib/php5;而目录 /home/guanli/php-5.4.9 是我们解压.tar.gz 之后的路径,也就是源代码路径。

例如 安装 bcmath 模块

# cd /home/guanli/php-5.4.9/ext

# cd openssl

#mv vonfig0.m4 config.m4

# cd -

# cd bcmath

# /var/lib/php5/bin/phpize

此时提示错误:
Configuring for:
PHP Api Version: 20100412
Zend Module Api No: 20100525
Zend Extension Api No: 220100525
Cannot find autoconf. Please check your autoconf installation and the $PHP_AUTOCONF environment variable. Then, rerun this script.

# yum install autoconf

#/var/lib/php5/bin/phpize

# ./configure --with-php-config=/var/lib/php5/bin/php-config

# make

# make test

# make install

执行完之后,会自动提示我们将bcmath.so模块加入到路径:/var/lib/php5/lib/php/extensions/no-debug-non-zts-20100525下面

接下来,在php.ini中设置扩展目录:

如果编译PHP的时候没有指定配置文件的位置,默认的php.ini应该被放到/var/lib/php5/lib下面才能被加载,其它地方已经谈到过了。

我们找到 ; extension_dir = "./",取消前面的注释,并改为:

extension_dir = "/var/lib/php5/lib/php/extensions/no-debug-non-zts-20100525"

再次添加扩展模块引用

extension = bcmath.so

到此,重启httpd服务,通过 phpinfo() 去验证,已经成功加载 bcmath 模块。


www.bkjia.comtruehttp://www.bkjia.com/PHPjc/477896.htmlTechArticle首先确认:我们在安装PHP时,指定了它的安装目录:--prefix=/var/lib/php5;而目录 /home/guanli/php-5.4.9 是我们解压.tar.gz 之后的路径,也就是源代...

免责声明

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱290110527@qq.com删除。

其他信息

其他资源

Top