duannuochi3549 2019-02-14 07:12
浏览 60
已采纳

调用未定义的函数xmlwriter_open_memory(),没有OOP

I am writing a school project in PHP but I am not using classes. I need to write the output to XML with wmlwriter_open_memory() and tried things like this:

$xml = xmlwriter_open_memory();

$xml = XMLWriter::xmlwriter_open_memory();

$xml = new XMLWriter();
...

But I get the call to undefined function error, but the curious thing is, I don't get the error when I remotely run in on the school server.

I am using PHP 7.2.15 and Ubuntu 18.04.1 LTS. Any ideas are appreciated.

  • 写回答

1条回答 默认 最新

  • dongzai5181 2019-02-16 08:40
    关注

    as @ThW has stated, I didn't have the extension installed, but my IDE recognized that the function exists, so that confused me the most.

    I've solved it by installing the php extension like this:

    sudo apt-get install php-xml
    

    and made sure that it is installed with this

    php -i | grep "xml"
    

    I found these commands here

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

报告相同问题?

悬赏问题

  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料