Pie, new extension installer for #PHP was released! Let’s have a look at it and see what it brings to the table.

Background

Pie is a successor of PECL and was designed and developed under the PHP Foundation.

You can read about its goals, roadmap and scope here, you can also watch its development and even contribute here.

Usage in Docker builds

I’ve created gist that shows how to install and use Pie in Docker builds, both Debian and Alpine 😊. Both were tricky, as Pie requires stuff not mentioned in the official docs (like ZIP extension, but also several build-related packages on Alpine).

With this setup, when you run docker compose build php-debian && docker compose run -it --rm php-debian php -v (use -alpine suffix for Alpine build), 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 😎. Please keep in mind you should also clean up the dev packages at the end of your build, example shown above is as minimal as possible to show Pie’s usage, it’s not focused on Docker optimisation.

Credits

If you found it useful, consider sharing my posts:

And of course: follow me for more 😁!