Linux下php的Ice_initialize方法报InvalidArgumentException异常
Closed this issue · 0 comments
dengly commented
根据官方例子开发了客户端,在Windows下一切运行正常,但是部署到Centos6系统后就悲剧了。在执行
$communicator = Ice_initialize($data);
时就报出InvalidArgumentException异常,
An uncaught Exception was encountered
Type: InvalidArgumentException
Message:unexpected argument type object
通过查看源码Communicator.cpp发现,应该是程序判断Ice.php的Ice_InitializationData类不是::Ice::InitializationData,于是修改了源码Communicator.cpp877行的判断
else if(Z_TYPE_PP(args[0]) == IS_OBJECT && Z_OBJCE_PP(args[0]) == initClass)
改为
else if(Z_TYPE_PP(args[0]) == IS_OBJECT)
重新编译安装后就正常了