rick645 Posted Thursday at 10:17 AM Share Posted Thursday at 10:17 AM (edited) + /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 Thursday at 10:23 AM by rick645 Quote Link to comment https://forums.phpfreaks.com/topic/326547-install-the-php82-xml-extension/ Share on other sites More sharing options...
Moorcam Posted Thursday at 12:18 PM Share Posted Thursday at 12:18 PM (edited) 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 Thursday at 12:19 PM by Moorcam Quote Link to comment https://forums.phpfreaks.com/topic/326547-install-the-php82-xml-extension/#findComment-1648059 Share on other sites More sharing options...
gizmola Posted Thursday at 07:07 PM Share Posted Thursday at 07:07 PM 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 Quote Link to comment https://forums.phpfreaks.com/topic/326547-install-the-php82-xml-extension/#findComment-1648076 Share on other sites More sharing options...
rick645 Posted Friday at 04:12 PM Author Share Posted Friday at 04:12 PM (edited) 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 Friday at 04:14 PM by rick645 Quote Link to comment https://forums.phpfreaks.com/topic/326547-install-the-php82-xml-extension/#findComment-1648126 Share on other sites More sharing options...
rick645 Posted Friday at 04:21 PM Author Share Posted Friday at 04:21 PM 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? Quote Link to comment https://forums.phpfreaks.com/topic/326547-install-the-php82-xml-extension/#findComment-1648128 Share on other sites More sharing options...
gizmola Posted Sunday at 08:50 AM Share Posted Sunday at 08:50 AM 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. Quote Link to comment https://forums.phpfreaks.com/topic/326547-install-the-php82-xml-extension/#findComment-1648215 Share on other sites More sharing options...
rick645 Posted Monday at 03:46 PM Author Share Posted Monday at 03:46 PM (edited) $ 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 Monday at 03:48 PM by rick645 Quote Link to comment https://forums.phpfreaks.com/topic/326547-install-the-php82-xml-extension/#findComment-1648287 Share on other sites More sharing options...
Solution gizmola Posted Monday at 08:04 PM Solution Share Posted Monday at 08:04 PM You don't need that package (php8.2-xml). XML support is already installed by default in the base 8.2 image. Quote Link to comment https://forums.phpfreaks.com/topic/326547-install-the-php82-xml-extension/#findComment-1648298 Share on other sites More sharing options...
rick645 Posted 18 hours ago Author Share Posted 18 hours ago thanks Quote Link to comment https://forums.phpfreaks.com/topic/326547-install-the-php82-xml-extension/#findComment-1648329 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.