amfext for PHP5.3扩展的安装

[size=medium][b]1. 下载amfext [/b][/size]
[url]http://www.teslacore.it/wiki/index.php?title=AMFEXT[/url]

[size=medium][b]2. 编译安装前工作 [/b][/size]
对于Windows系统,请参考文章
对于Linux系统,需要修改源码amf.c才能在php5.3中make 通过

On line 1188, replace:
int deallocResult = (*struc)->refcount;
with
int deallocResult = Z_REFCOUNT_PP(struc);


On line 2674, replace:
newval->refcount--;
with
Z_DELREF_P(newval);

为了配合AMFPHP使用amfext,还需要做以下修改

Check your apache logs for the errors. If the log contains the following line:
‘Symbol not found: _ZVAL_ADDREF’
or
‘undefined symbol: ZVAL_ADDREF’.
After making above changes to amf.c, You also need to replace ZVAL_ADDREF with Z_ADDREF_P to solve the problem.


[size=medium][b]3. 开始编译安装[/b][/size]

./configure --with-php-config=/usr/local/php/bin/php-config
make
make install

生成amf.so

[size=medium][b]4.例子[/b][/size]
虽然phpinfo显示安装成功,但是官方例子

$r = amf_encode("hello world",AMF_AS_STRING_BUILDER); // ask to return a SB
echo("returned type: " . $r . "\n");
echo("returned length: " . amf_sb_length($r) . "\n");
$sb1 = amf_sb_new();
amf_sb_append($sb1,"prefix");
amf_encode("hello world",0,"",$sb1); // store the result into the provided SB
echo("returned type: " . $sb1 . "\n");
echo("returned length: " . amf_sb_length($sb1) . "\n");

AMF_AS_STRING_BUILDER始终提示未定义。

另外,amfphp自动识别amfext扩展是否安装,如果安装,它自动使用amfext编码解码,结果发现amfext安装后,amfphp就不能工作了,原因不明啊(调查中)!
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值