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:
ddev start, and it takes a long time on the first ddev 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.ddev utility rebuild or DDEV_VERBOSE=true ddev start.php_version setting is ignored.ddev utility rebuild -s web --cachephp-fpm) which can be used to replace the ones installed in ddev-webserver..ddev/web-build/Dockerfile.php-patch-build does the building.# Set your desired PHP version, when prompted, e.g., 8.0.10
ddev add-on get rfay/ddev-php-patch-build
ddev restart
After installation, make sure to commit the .ddev directory to version control.
You can choose a different PHP version with:
ddev dotenv set .ddev/.env.php-patch-build --static-php-version=8.0.10
ddev add-on get rfay/ddev-php-patch-build
ddev restart
After installation, make sure to commit the .ddev directory to version control.
If you hit GitHub rate limits while downloading static-php-cli extensions, export your token before running ddev start to build the PHP binaries:
export GITHUB_TOKEN=your_github_token
| Variable | Flag | Default |
|---|---|---|
STATIC_PHP_EXTENSIONS |
--static-php-extensions |
apcu,bcmath,ctype,curl,dom,fileinfo,filter,ftp,gd,mbstring,openssl,pdo,pdo_mysql,pdo_pgsql,pdo_sqlite,phar,session,simplexml,sqlite3,tokenizer,xml |
STATIC_PHP_VERSION |
--static-php-version |
required, (not set) |
Contributed and maintained by @rfay