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

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

报告相同问题?

悬赏问题

  • ¥20 机器学习能否像多层线性模型一样处理嵌套数据
  • ¥20 西门子S7-Graph,S7-300,梯形图
  • ¥50 用易语言http 访问不了网页
  • ¥50 safari浏览器fetch提交数据后数据丢失问题
  • ¥15 matlab不知道怎么改,求解答!!
  • ¥15 永磁直线电机的电流环pi调不出来
  • ¥15 用stata实现聚类的代码
  • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效