chialab/docker-php

XDebug fails to install in PHP 5.4 dev image

Closed this issue ยท 7 comments

XDebug extension became unavailable in PHP 5.4, and can't be installed via PECL anymore:

Step 3 : RUN pecl install xdebug     && echo "zend_extension=\"$(php-config --extension-dir)/xdebug.so\"" > $PHP_INI_DIR/conf.d/xdebug.ini
 ---> Running in fe7f8e74e4cb
pecl/xdebug requires PHP (version >= 5.5.0), installed version is 5.4.45
No valid packages found
install failed
The command '/bin/sh -c pecl install xdebug     && echo "zend_extension=\"$(php-config --extension-dir)/xdebug.so\"" > $PHP_INI_DIR/conf.d/xdebug.ini' returned a non-zero code: 1

How was this bug fixed by removing 5.4 from CI?

@fuzzy76 Yeah, I know it is not a "solution" properly said. ๐Ÿ˜ž However, since PHP 5.4 became end-of-life long ago, I thought that it would have been simpler to just drop it.

Images with PHP 5.4 and XDebug are just no longer built โ€” not only not tested on CI ๐Ÿ˜‚ . You can still find the old versions on Docker Hub, but, as you can see from here, the latest one is from six months ago.

If you need it updated, however, feel free to open an issue (or we can re-open this one), so we can sort it out. ๐Ÿ˜‰

I actually use this image for the sole purpose of isolating an old legacy PHP 5.4 web app, since it was the best fit I could find (fairly updated and with PHP 5.4 is pretty rare). But xdebug is not an absolute requirement for me yet, so you probably have better stuff to spend your time on. :) I just hope you won't remove PHP 5.4 completely. I see some general fixes has been applied to the sources for that image since the last build.

I assume you're talking about chialab/php-dev. ๐Ÿค” If XDebug is not required, you should probably take a look at chialab/php instead. For those images, XDebug is not installed, and PHP 5.4 images should be fairly up-to-date โ€” as far as I can see, latest build was 10 days ago.

However, keep in mind that these images are built on top of official PHP images. Thus, they can't be "much more up-to-date" (...) than their official counterpart.

Actually I was talking about chialab/php - I prefer to use the same image for local development, just run a script after build for doing some environment changes.

FWIW, the issue description is pretty unaccurate. I thought everything was broken, but the problem is that xdebug 2.5.0 require PHP 5.5 or higher. So installing xdebug-2.4.1 as a normal PECL works like a charm for PHP 5.4.

RUN pecl install xdebug-2.4.1 && docker-php-ext-enable xdebug