TrafeX/docker-php-nginx

The XML extension doesn't work

Closed this issue · 1 comments

The docker image already has the XML extension. But it cannot run SimpleXML Functions. For example, the following code will trigger a Fatal error:

<?php
$string = <<<XML
<?xml version='1.0'?> 
<document>
 <title>Forty What?</title>
 <from>Joe</from>
 <to>Jane</to>
 <body>
  I know that's the answer -- but what's the question?
 </body>
</document>
XML;

$xml = simplexml_load_string($string);

print_r($xml);

The error is PHP Fatal error: Uncaught Error: Call to undefined function simplexml_load_string(). You can see it with the docker logs command.

Hi @tunggnu,

You need to install php84-simplexml for this to work;

RUN apk add --no-cache php84-simplexml