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

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

WBOY
WBOYOriginal
2016-07-14 10:07:08700Durchsuche

    首先确认:我们在安装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 之后的路径,也就是源代...
Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn