DDEV users periodically ask if they can use a specific PHP patch version with their projects, either to test/compare for a particular bug or to match a production version exactly.
This experimental add-on tries to address that need, although there are a number of caveats:
- The build done using this process uses the technique from static-php-cli and full details are available there. Currently it supports PHP 7.3-8.3.
- The build does not match the build done using the official DDEV php packages (which actually come from deb.sury.org.
- It currently does not provide xdebug, see extension support.
- The resultant PHP binaries built here do not have the exact same extensions as the official DDEV PHP binaries.
- Building the binaries happens in the build phase of
ddev start
, and it takes a long time on the firstddev start
or whenever you change versions. My tests on Gitpod, with a great internet connection, took about 8-9 minutes. It can be really annoying, and a better way to build would be an improvement. - If you want to see the build process as it proceeds, you can use
ddev debug refresh
orDDEV_VERBOSE=true ddev start
. - Your mileage may vary.
- The static-php-ci repository provides a relatively easy way to build static PHP binaries (the CLI and
php-fpm
) which can be used to replace the ones installed inddev-webserver
. - The provided Dockerfile.php-patch-build does the building.
- The provided
config.php-patch-build
provides post-start hooks that install the built binaries.
ddev get rfay/ddev-php-patch-build
config.php-yaml
Dockerfile.php-patch-build
- A test suite in test.bats that makes sure the service continues to work as expected.
- Github actions setup so that the tests run automatically when you push to the repository.
Contributed and maintained by @rfay