Heim  >  Artikel  >  Backend-Entwicklung  >  Ubuntu12.1下独立安装PHP的扩充库

Ubuntu12.1下独立安装PHP的扩充库

WBOY
WBOYOriginal
2016-06-13 12:14:361142Durchsuche

Ubuntu12.1下独立安装PHP的扩张库


Ubuntu是一个在Linux界非常不错的系统  ,其中安装PHP非常普遍,那么如何独立安装PHP扩展库?

参考步骤如下:

1.进入php源码包下的ext;(这里PHP版本php-5.4.37,那扩展包gd库举例)

[email protected]:~/temp/php-5.4.37/ext$ cd gd

2.通过phpize工具生成configure脚本文件

[email protected]:~/temp/php-5.4.37/ext/gd$ sudo phpize

3.可以按照正常的编译方法,开始编译扩展包了。

$ ./configure$ make# make install

注意:如果安装有多个PHP,需要指明采用那个PHP来编译;如下例:

<span class="html">./configure --with-php-config=/usr/local/lib/php/extensions</span>

另外,make之后就会在源码包下/ext/gd/modules中生成gd.so库,可以选择不用执行make install,通过手动拷贝gd.so到需要的路径下。


参考地址:http://php.net/manual/zh/install.pecl.phpize.php

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