Jump to content

install the php8.2-xml extension


Go to solution Solved by gizmola,

Recommended Posts

+ /usr/bin/docker run --rm php:8.2 \
    php -r "echo XMLDiff\File::merge();"
Fatal error: Uncaught Error: Class "XMLDiff\File" not found in Command line code:1

mmmhhh...

Perhaps the appropriate extension must be installed (it should be php8.2-xml).
So let's do this

+ cat Dockerfile
FROM php:8.2
	RUN apt-get update \
    && apt-get -y install php8.2-xml \
    && docker-php-ext-install php8.2-xml \
    && docker-php-ext-enable php8.2-xml
+ /usr/bin/docker build -t test .
[+] Building 7.4s (5/5) FINISHED                                                                        docker:default
 => [internal] load build definition from Dockerfile                                                              0.0s
 => => transferring dockerfile: 196B                                                                              0.0s
 => [internal] load metadata for docker.io/library/php:8.2                                                        0.0s
 => [internal] load .dockerignore                                                                                 0.0s
 => => transferring context: 2B                                                                                   0.0s
 => CACHED [1/2] FROM docker.io/library/php:8.2                                                                   0.0s
 => ERROR [2/2] RUN apt-get update     && apt-get -y install php8.2-xml     && docker-php-ext-install php8.2-xml  7.3s
------                                                                                                                 
 > [2/2] RUN apt-get update     && apt-get -y install php8.2-xml     && docker-php-ext-install php8.2-xml     && docker-php-ext-enable php8.2-xml:                                                                                            
0.342 Get:1 http://deb.debian.org/debianbookworm InRelease [151 kB]                                                   
0.469 Get:2 http://deb.debian.org/debianbookworm-updates InRelease [55.4 kB]                                          
0.539 Get:3 http://deb.debian.org/debian-securitybookworm-security InRelease [48.0 kB]                                
0.597 Get:4 http://deb.debian.org/debianbookworm/main amd64 Packages [8792 kB]
4.851 Get:5 http://deb.debian.org/debianbookworm-updates/main amd64 Packages [13.5 kB]
4.861 Get:6 http://deb.debian.org/debian-securitybookworm-security/main amd64 Packages [241 kB]
5.883 Fetched 9301 kB in 6s (1653 kB/s)
5.883 Reading package lists...
6.445 Reading package lists...
7.019 Building dependency tree...
7.167 Reading state information...
7.175 Package php8.2-xml is not available, but is referred to by another package.
7.175 This may mean that the package is missing, has been obsoleted, or
7.175 is only available from another source
7.175
7.179 E: Package 'php8.2-xml' has no installation candidate
------
Dockerfile:3
--------------------
   2 |     
   3 | >>> RUN apt-get update \
   4 | >>>     && apt-get -y install php8.2-xml \
   5 | >>>     && docker-php-ext-install php8.2-xml \
   6 | >>>     && docker-php-ext-enable php8.2-xml
   7 |     
--------------------
ERROR: failed to solve: process "/bin/sh -c apt-get update     && apt-get -y install php8.2-xml     && docker-php-ext-install php8.2-xml     && docker-php-ext-enable php8.2-xml" did not complete successfully: exit code: 100


 

Why?

Obviously, consequently


+ /usr/bin/docker run test \
    php -r "echo XMLDiff\File::merge();"
Unable to find image 'test:latest' locally
docker: Error response from daemon: pull access denied for test, repository does not exist or may require 'docker login': denied: requested access to the resource is denied.

So, how do you install the php8.2-xml extension?

Edited by rick645
Link to comment
https://forums.phpfreaks.com/topic/326547-install-the-php82-xml-extension/
Share on other sites

2 hours ago, rick645 said:

 

+ /usr/bin/docker run --rm php:8.2 \
    php -r "echo XMLDiff\File::merge();"
Fatal error: Uncaught Error: Class "XMLDiff\File" not found in Command line code:1

 

mmmhhh...

Perhaps the appropriate extension must be installed (it should be php8.2-xml).
So let's do this

 

+ cat Dockerfile
FROM php:8.2
	RUN apt-get update \
    && apt-get -y install php8.2-xml \
    && docker-php-ext-install php8.2-xml \
    && docker-php-ext-enable php8.2-xml
+ /usr/bin/docker build -t test .
[+] Building 7.4s (5/5) FINISHED                                                                        docker:default
 => [internal] load build definition from Dockerfile                                                              0.0s
 => => transferring dockerfile: 196B                                                                              0.0s
 => [internal] load metadata for docker.io/library/php:8.2                                                        0.0s
 => [internal] load .dockerignore                                                                                 0.0s
 => => transferring context: 2B                                                                                   0.0s
 => CACHED [1/2] FROM docker.io/library/php:8.2                                                                   0.0s
 => ERROR [2/2] RUN apt-get update     && apt-get -y install php8.2-xml     && docker-php-ext-install php8.2-xml  7.3s
------                                                                                                                 
 > [2/2] RUN apt-get update     && apt-get -y install php8.2-xml     && docker-php-ext-install php8.2-xml     && docker-php-ext-enable php8.2-xml:                                                                                            
0.342 Get:1 http://deb.debian.org/debianbookworm InRelease [151 kB]                                                   
0.469 Get:2 http://deb.debian.org/debianbookworm-updates InRelease [55.4 kB]                                          
0.539 Get:3 http://deb.debian.org/debian-securitybookworm-security InRelease [48.0 kB]                                
0.597 Get:4 http://deb.debian.org/debianbookworm/main amd64 Packages [8792 kB]
4.851 Get:5 http://deb.debian.org/debianbookworm-updates/main amd64 Packages [13.5 kB]
4.861 Get:6 http://deb.debian.org/debian-securitybookworm-security/main amd64 Packages [241 kB]
5.883 Fetched 9301 kB in 6s (1653 kB/s)
5.883 Reading package lists...
6.445 Reading package lists...
7.019 Building dependency tree...
7.167 Reading state information...
7.175 Package php8.2-xml is not available, but is referred to by another package.
7.175 This may mean that the package is missing, has been obsoleted, or
7.175 is only available from another source
7.175
7.179 E: Package 'php8.2-xml' has no installation candidate
------
Dockerfile:3
--------------------
   2 |     
   3 | >>> RUN apt-get update \
   4 | >>>     && apt-get -y install php8.2-xml \
   5 | >>>     && docker-php-ext-install php8.2-xml \
   6 | >>>     && docker-php-ext-enable php8.2-xml
   7 |     
--------------------
ERROR: failed to solve: process "/bin/sh -c apt-get update     && apt-get -y install php8.2-xml     && docker-php-ext-install php8.2-xml     && docker-php-ext-enable php8.2-xml" did not complete successfully: exit code: 100


 

Why?

Obviously, consequently

 

+ /usr/bin/docker run test \
    php -r "echo XMLDiff\File::merge();"
Unable to find image 'test:latest' locally
docker: Error response from daemon: pull access denied for test, repository does not exist or may require 'docker login': denied: requested access to the resource is denied.

 

So, how do you install the php8.2-xml extension?

I'm no expert but the error you are getting is indicating that you may need to login to Docker or the repo doesn't exist. Check the repo name and your access rights, I guess.

Edited by Moorcam
Quote

I'm no expert but the error you are getting is indicating that you may need to login to Docker or the repo doesn't exist.

$ docker login -u blabla...
Password: 
WARNING! Your password will be stored unencrypted in /home/rino/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credential-stores

Login Succeeded

$ docker build .
RUN apt-get update \
    && apt-get -y install php-xml
blabla...
7.782 E: Package 'php-xml' has no installation candidate
Quote

Check the repo name

More precisely?

Quote

and your access rights, I guess.

More precisely?

Edited by rick645
21 hours ago, gizmola said:

Install via apt should take care of installation of the extension, so I don't think you need these:

   && docker-php-ext-install php8.2-xml \
    && docker-php-ext-enable php8.2-xml

 

Ok, but, details aside, do you have any solution?

Did you try to remove those lines and if so, since they were redundant and problematic, what result did you have?

You could also provide the Dockerfile you are using, which would allow others to recreate your experience.

$ cat Dockerfile 
FROM php:8.2
RUN apt-get update \
    && apt-get -y install php8.2-xml



$ docker build .
[+] Building 6.7s (5/5) FINISHED                                                                        docker:default
 => [internal] load build definition from Dockerfile                                                              0.0s
 => => transferring dockerfile: 109B                                                                              0.0s
 => [internal] load metadata for docker.io/library/php:8.2                                                        0.0s
 => [internal] load .dockerignore                                                                                 0.0s
 => => transferring context: 2B                                                                                   0.0s
 => CACHED [1/2] FROM docker.io/library/php:8.2                                                                   0.0s
 => ERROR [2/2] RUN apt-get update     && apt-get -y install php8.2-xml                                           6.5s
------                                                                                                                 
 > [2/2] RUN apt-get update     && apt-get -y install php8.2-xml:                                                      
0.349 Get:1 http://deb.debian.org/debian bookworm InRelease [151 kB]                                                   
0.477 Get:2 http://deb.debian.org/debian bookworm-updates InRelease [55.4 kB]                                          
0.533 Get:3 http://deb.debian.org/debian-security bookworm-security InRelease [47.9 kB]                                
0.585 Get:4 http://deb.debian.org/debian bookworm/main amd64 Packages [8792 kB]                                        
4.158 Get:5 http://deb.debian.org/debian bookworm-updates/main amd64 Packages [13.5 kB]
4.168 Get:6 http://deb.debian.org/debian-security bookworm-security/main amd64 Packages [241 kB]
5.182 Fetched 9301 kB in 5s (1881 kB/s)
5.182 Reading package lists...
5.746 Reading package lists...
6.326 Building dependency tree...
6.472 Reading state information...
6.480 Package php8.2-xml is not available, but is referred to by another package.
6.480 This may mean that the package is missing, has been obsoleted, or
6.480 is only available from another source
6.480 
6.484 E: Package 'php8.2-xml' has no installation candidate
------
Dockerfile:2
--------------------
   1 |     FROM php:8.2
   2 | >>> 	RUN apt-get update \
   3 | >>>     && apt-get -y install php8.2-xml
   4 |     
--------------------
ERROR: failed to solve: process "/bin/sh -c apt-get update     && apt-get -y install php8.2-xml" did not complete successfully: exit code: 100

Why?

Edited by rick645

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.