doufusi2013 2010-10-27 08:11 采纳率: 0%
浏览 47
已采纳

too long

(I'm using PHP 5.2.6 and phpinfo says it has libxml 2.6.32 loaded)

I'm also using wordpress and whenever xml_parse() function is called I get &lt; and &gt; stripped out from the result, instead of being converted to "<" and ">".

I found people talking this is a bug which hits newer versions of libxml but I have the old one and it still happnes to me. Weird thing is that I have same PHP/libxml dev setup on my Windows WAMP based apache server and it does not happen there.

My question is do you know how can I make xml_parse behave how it should? And how can I upgrade my libxml on the Fedora prod server. yum says that libxml2 that I have installed is 2.7.2, but like I said phpinfo says libxml is 2.6.32. How to make PHP use a newer version of libxml?

Edit: For example this is what result is on my dev server:

<OrderResponse ID="XXX" Signature="XXX"><Reference>XXX</Reference><URL>http://XXX</URL><ErrCode>0</ErrCode><ErrText></ErrText></OrderResponse>

And this is what I get on my prod server:

OrderResponse ID="XXX" Signature="XXX/ReferenceURLhttp://XXX/URLErrCode0/ErrCodeErrText/ErrText/OrderResponse
  • 写回答

1条回答 默认 最新

  • du5591 2010-10-27 11:46
    关注

    Let me answer my own question.

    Problem was in fact that PHP was using libxml 2.7.2 and phpinfo() was showing WRONG information about libxml... 2.6.32 version that phpinfo() was wrongly stating PHP has been using is the version PHP was compiled with, but obviously was running with libxml 2.7.2 as we seen in the list of running processes.

    So, the solution is to compile libxml 2.6.32 and install it. Once PHP started with libxml 2.6.32 this problem went away.

    Point of the story is don't trust what phpinfo() is telling you. Always make double checks.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 安装svn网络有问题怎么办
  • ¥15 Python爬取指定微博话题下的内容,保存为txt
  • ¥15 vue2登录调用后端接口如何实现
  • ¥65 永磁型步进电机PID算法
  • ¥15 sqlite 附加(attach database)加密数据库时,返回26是什么原因呢?
  • ¥88 找成都本地经验丰富懂小程序开发的技术大咖
  • ¥15 如何处理复杂数据表格的除法运算
  • ¥15 如何用stc8h1k08的片子做485数据透传的功能?(关键词-串口)
  • ¥15 有兄弟姐妹会用word插图功能制作类似citespace的图片吗?
  • ¥15 latex怎么处理论文引理引用参考文献