Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

php7-dev missing from php:7.4-fpm-alpine #1300

Closed
rairlie opened this issue May 26, 2022 · 4 comments
Closed

php7-dev missing from php:7.4-fpm-alpine #1300

rairlie opened this issue May 26, 2022 · 4 comments
Labels
question Usability question, not directly related to an error with the image

Comments

@rairlie
Copy link

rairlie commented May 26, 2022

Unable to install php7-dev on latest php:7.4-fpm-alpine (alpine 3.16):

$ docker run -it --rm php:7.4-fpm-alpine apk add -U php7-dev
fetch https://dl-cdn.alpinelinux.org/alpine/v3.16/main/x86_64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.16/community/x86_64/APKINDEX.tar.gz
ERROR: unable to select packages:
  php7-dev (no such package):
    required by: world[php7-dev]

This previously worked in php:7.4-fpm-alpine3.15:

$ docker run -it --rm php:7.4-fpm-alpine3.15 apk add -U php7-dev
fetch https://dl-cdn.alpinelinux.org/alpine/v3.15/main/x86_64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.15/community/x86_64/APKINDEX.tar.gz
(1/20) Upgrading zlib (1.2.12-r0 -> 1.2.12-r1)
(2/20) Installing php7-common (7.4.29-r0)
(3/20) Installing libedit (20210910.3.1-r0)
(4/20) Installing pcre2 (10.39-r0)
(5/20) Installing php7 (7.4.29-r0)
(6/20) Installing m4 (1.4.18-r2)
(7/20) Installing libbz2 (1.0.8-r1)
(8/20) Installing perl (5.34.0-r1)
(9/20) Installing autoconf (2.71-r0)
(10/20) Installing pkgconf (1.8.0-r0)
(11/20) Installing ncurses-dev (6.3_p20211120-r0)
(12/20) Installing libedit-dev (20210910.3.1-r0)
(13/20) Installing zlib-dev (1.2.12-r1)
(14/20) Installing libpcre2-16 (10.39-r0)
(15/20) Installing libpcre2-32 (10.39-r0)
(16/20) Installing pcre2-dev (10.39-r0)
(17/20) Installing libgcc (10.3.1_git20211027-r0)
(18/20) Installing libstdc++ (10.3.1_git20211027-r0)
(19/20) Installing re2c (2.1.1-r0)
(20/20) Installing php7-dev (7.4.29-r0)
Executing busybox-1.34.1-r5.trigger
OK: 76 MiB in 52 packages

It looks like php7-dev is not in alpine 3.16: https://pkgs.alpinelinux.org/packages?name=php7-dev&branch=v3.16

image

@wglambert wglambert added the question Usability question, not directly related to an error with the image label May 26, 2022
@wglambert
Copy link

Yeah the package isn't on the Alpine 3.16 repos. So using Alpine 3.15 in the meantime is probably the best workaround

@wbianchini
Copy link

wbianchini commented May 26, 2022

Alpine moved php7 to testing repositories Release_Notes_for_Alpine_3.16.0#php7_moved_to_testing

You need to indicate the repository or add it to /etc/apk/repositories

$ docker run -it --rm php:7.4-fpm-alpine apk add -U php7-dev --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing

@tianon
Copy link
Member

tianon commented May 26, 2022

If you're using apk to install PHP, then this image is not what you're looking for. 😬

If you need the PHP source code within the image, you should use docker-php-source extract and you will then find the source code at /usr/src/php (which is how docker-php-ext-* scripts work).

When you apk add a PHP package, you end up with two (incompatible) versions of PHP inside your image.

@tianon tianon closed this as completed May 26, 2022
@yosifkit
Copy link
Member

From #672 (comment):

When you install php* packages via apk, you're installing Alpine's PHP package (and thus if you're FROM php:xxx, you've got two copies of PHP included in the image). This image provides PHP in the way that PHP upstream recommends and supports, which is downloaded and built from source. If you want to continue using this PHP image, you'll need to download and compile modules like gd from source as well. For modules which are built-in (like gd), you can use the helper scripts we provide to do so (docker-php-ext-install, etc).

See the section titled "How to install more PHP extensions" on https://hub.docker.com/_/php/ (https://github.com/docker-library/docs/blob/7aeed6ad70a0ccdce57d42e4a152fa0dfbedbbc4/php/README.md#how-to-install-more-php-extensions).

See also #542.

combro2k pushed a commit to combro2k/dockerfiles that referenced this issue May 30, 2022
kendarorg pushed a commit to kendarorg/HttpAnsweringMachine that referenced this issue Jan 13, 2023
sorphin pushed a commit to sorphin/HttpAnsweringMachine that referenced this issue Nov 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Usability question, not directly related to an error with the image
Projects
None yet
Development

No branches or pull requests

5 participants