It seems to be a problem with the pckages of the Linux distribution. But the official PHP image is not based on the PHP installed from APT repositories. So you should not install any php module from APT repositories as there is no PHP for that.
The official image description shows how you can install modules. But can’t tell you what php-xml would install so I don’t know what module name you would need.
There are a lot of examples and I don’t know which one to use.
Let’s pretend that I want to install docker php image, the php-xml extension.
How should I do?
You need a PHP extension so read the “How to install more PHP extensions” part. Ofcourse you need to know which extension you want to use. Then you can start searching for ways to install it. The documentation always shows which fucntion requires what extension since the function’s documentations are categorized by the libraries from which you can find extension names. You click the parent pages in the navigation bar and search for the “Introduction” and/or “Installing/configuring” links. .
Actually it couldn’t be straighter as PHP developers should be familiar with the PHP documentation and this is a Docker community forum where users can also have some PHP experiences, but not necessarily actively practicing it.
The page @bluepuma77 shared is the list of XML-related libraries/extensions where you can find “Introduce” and “installing/configuring” links. If you know which function, class you need, you can find which library you need and which extension you need. And finally how it should be installed if it has to be installed at all, since some extensions are available by default.
Now we arrived to the point which indeed requires Docker-related skills or at least a good Linux skills as you need to find out which libraries are required on Linux to build a PHP extension. You can find examples in my repository and if this is what you need, this iss the xml extenions
I don’t know if this is what php-xml was supposed to install or not.
Are you kidding? Check the page, PHP has multiple XML libraries. Check which one you want to use or which one your code requires. Library names have changed over time.
You confused my post with @bluepuma77’s post. I replied to your post about the official image description not the PHP docs…
It is not whether you want or not. The official PHP images contain PHP versions built from source code so extensions are built from source as well. The Docker image just provides scripts that make it easier, and in some cases, the extension is built-in, so you just need to enable it. But if it has to be built, you need to install required libraries which you can remove after a successfull build, unless it is required in runtime as well.
This is what I referred to as required good “Linux skills” as PHP developers might be familiar with the structure of the PHP documentation, but not necessarily the way to recognize which library is required based on error messages, although, in many cases the package name is specifically mentioned.