This Gist shows how to install and use Pie (new PHP's extension installer) in your Docker builds:
- how to install pre-requisities (keep in mind you should also clean up the dev packages at the end of your build)
- how to install Pie itself
- how to install PHP extensions using Pie
Clone the gist's code and run docker compose build php-debian && docker compose run -it --rm php-debian php -v
(use -alpine
suffix for Alpine build), then you should see the output like:
PHP 8.3.13 (cli) (built: Nov 12 2024 05:52:30) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.3.13, Copyright (c) Zend Technologies
with Xdebug v3.4.0beta1, Copyright (c) 2002-2024, by Derick Rethans
which means Pie successfully installed XDebug 😎.
If you found it useful, consider sharing my posts:
Follow me for more 😁!