docker-library / docker-library/php
Issue with pecl not falling back to IPv4 when IPv6 is preferred
Nobody has claimed this yet.
- Dominant language
- Dockerfile
- Stars
- 4k
- Forks
- 2k
- Avg merge
- 5d 21h
- Merged PRs (30d)
- 1
Description
Recently I tried setting up the latest 8.5-fpm container. From the instructions on this page you suggest the install-php-extensions script. Building the container worked great locally, but when building it on the server it seemed to get stuck when trying to reach pecl.php.net during the install-php-extensions script (used v2.11.12). All other commands worked fine (installing packages, pulling from github, etc). The final error message always looked something like:
No releases available for package "pecl.php.net/extension-name"
install failed
Turns out the server had IPv6 connectivity issues and the server was set to prefer IPv6 over IPv4. All other commands on the server fell back to IPv4 except pecl, which just seems to give up. To work around the issue I modified /etc/gai.conf to temporarily prefer IPv4 over IPv6 before running install-php-extensions.
Since pecl is deprecated I don't really expect a fix, but since the script using pecl is recommended from the php image page it might be useful to document this issue somewhere.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Review the PHP Docker Hub instructions and the install-php-extensions v2.11.12 context described in the issue. Document the PECL failure when IPv6 is preferred but unavailable, including the reported IPv4-preference workaround. Done means users can find and understand this limitation before building the container.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, php
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100