docker-php-extension-installer: xdebug installation fails on 8.x debian (missing lib/php-header.h)
Version of install-php-extensions
v.1.5.29
Error description
Build fails in Docker build for RUN install-php-extensions xdebug.
With fatal error: lib/php-header.h: No such file or directory
See for example https://github.com/yiisoft/yii-docker/runs/7444548717?check_suite_focus=true#step:6:752 - also tested with the command above.
2: compilation terminated.
2: make: *** [Makefile:286: src/lib/lib.lo] Error 1
2: cc -I. -I/tmp/pickle.tmp/xdebug/xdebug-3.2.0alpha1 -I/tmp/pickle.tmp/pickle-7f747bef79dcb11e3af9f2d35a5c23574d431cf4/include -I/tmp/pickle.tmp/pickle-7f747bef79dcb11e3af9f2d35a5c23574d431cf4/main -I/tmp/pickle.tmp/xdebug/xdebug-3.2.0alpha1 -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -I/tmp/pickle.tmp/xdebug/xdebug-3.2.0alpha1/src -I/tmp/pickle.tmp/pickle-7f747bef79dcb11e3af9f2d35a5c23574d431cf4/src -DHAVE_CONFIG_H -g -O2 -DZEND_COMPILE_DL_EXT=1 -c /tmp/pickle.tmp/xdebug/xdebug-3.2.0alpha1/src/lib/usefulstuff.c -MMD -MF src/lib/usefulstuff.dep -MT src/lib/usefulstuff.lo -fPIC -DPIC -o src/lib/.libs/usefulstuff.o
2: make: *** [Makefile:304: src/lib/var.lo] Error 1
2: make: *** [Makefile:262: src/base/base.lo] Error 1
2: /tmp/pickle.tmp/xdebug/xdebug-3.2.0alpha1/src/lib/compat.c:42:10: fatal error: lib/php-header.h: No such file or directory
2: 42 | #include "lib/php-header.h"
2: | ^~~~~~~~~~~~~~~~~~
2: compilation terminated.
2: make: *** [Makefile:271: src/lib/compat.lo] Error 1
2: /tmp/pickle.tmp/xdebug/xdebug-3.2.0alpha1/src/lib/str.c:23:10: fatal error: lib/php-header.h: No such file or directory
2: 23 | #include "lib/php-header.h"
2: | ^~~~~~~~~~~~~~~~~~
2: compilation terminated.
2: make: *** [Makefile:298: src/lib/str.lo] Error 1
2: In file included from /tmp/pickle.tmp/xdebug/xdebug-3.2.0alpha1/src/lib/usefulstuff.c:33:
2: /tmp/pickle.tmp/xdebug/xdebug-3.2.0alpha1/php_xdebug.h:28:10: fatal error: lib/php-header.h: No such file or directory
2: 28 | #include "lib/php-header.h"
2: | ^~~~~~~~~~~~~~~~~~
2: compilation terminated.
2: make: *** [Makefile:268: src/lib/usefulstuff.lo] Error 1The command '/bin/sh -c install-php-extensions xdebug' returned a non-zero code: 1
Docker image
php:8.x
Minimal Dockerfile
FROM php:8.1-apache
COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/
RUN install-php-extensions \
xdebug
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 3
- Comments: 19 (7 by maintainers)
@igoooor this issue consist of multiple problems.
If xdebug alpha release had no errors, then you’d silently get an alpha version this thread wouldn’t exist at all 😄
So this is not a docker-php-extension-installer issue at all. I’ll try to dig the problem with pickle.
Docs:
The latest xdebug release on PECL (3.2.0alpha, 2022-07-20) is not stable, but alpha.
A workaround until that’s fixed would be to tag a specific version:
Or require stable:
On an image building on 8.1:fpm-alpine, the error was:
That’s because I also added
-stableto mongodb, see https://github.com/yiisoft/yii2-docker/commit/844bca2c713da69f0bb792c1298dcc3b6ab57c3f#diff-ed02e61dc347b6860c1d27ec862b61edbaf946278dcf92348a5a1a4a4c05f3f8R59Because I thought that would be the proper way to install a stable version for the installed PHP version. But it looks to me like it just picks the very latest stable version of the extension and does not care about the PHP version.
Having the same problem with Alpine.
Actually, this is kinda strange, because the version is marked as beta on pecl:
For me
install xdebugthat prints(installing version stable)should not install beta versions 😃@mlocati, what do you think about the issue?