php自己编译扩展,PHP: 将 PECL 扩展库静态编译入 PHP - Manual

将 PECL 扩展库静态编译入 PHP

有时可能需要将扩展库静态编译到 PHP 中。这需要将扩展库源程序放入

/your/phpsrcdir/ext/ 目录中去并告诉 PHP

编译系统来生成其配置脚本。

$ cd /your/phpsrcdir/ext

$ pecl download extname

$ gzip -d < extname.tgz | tar -xvf -

$ mv extname-x.x.x extname

这将产生以下目录:

/your/phpsrcdir/ext/extname

此时强制 PHP 重新生成配置脚本,然后正常编译 PHP:

$ cd /your/phpsrcdir

$ rm configure

$ ./buildconf --force

$ ./configure --help

$ ./configure --with-extname --enable-someotherext --with-foobar

$ make

$ make install

注意:

要运行“buildconf”脚本,需要 autoconf 2.13 和 automake 1.4+(更新版本的

autoconf 也许能工作,但不被支持)。

是否用 --enable-extname 或 --with-extname

取决于扩展库。通常不需要外部库文件的扩展库使用

--enable。要确认的话,在 buildconf 之后运行:

$ ./configure --help | grep extname

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值