mlocati / docker-php-extension-installer

Easily install PHP extensions in Docker containers
MIT License
4.26k stars 384 forks source link

Can't install xdebug #914

Closed terax6669 closed 5 months ago

terax6669 commented 6 months ago

Version of install-php-extensions

2.2.12

Error description

Check if the xdebug module can be loaded... Error loading the "xdebug" extension:
[22-Apr-2024 11:56:27 UTC] PHP Warning:  JIT is incompatible with third party extensions that override zend_execute_ex(). JIT disabled. in Unknown on line 0
------
failed to solve: process "/bin/sh -c IPE_DONT_ENABLE=1 install-php-extensions xdebug" did not complete successfully: exit code: 1

Even though I've set IPE_DONT_ENABLE (for this exact reason), the install script still attempts for enable xdebug for testing. There's no flag to prevent this behavior thus making installation impossible.

Docker image

php:8.3-cli

Minimal Dockerfile

FROM php:8.3-cli

ADD --chmod=0755 https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/

RUN echo 'zend_extension=opcache.so\nopcache.jit_buffer_size=256M\nopcache.enable=1\nopcache.enable_cli=1' > /usr/local/etc/php/conf.d/0-opcache.ini

RUN install-php-extensions xdebug
mlocati commented 5 months ago

IPE_DONT_ENABLE controls if an extension should be enabled or not.

We need another way to tell the script to skip checking if an extension actually works: what about #915?

terax6669 commented 5 months ago

I'm not sure I understand the code, but as long as it skips the check entirely that works for me. I'll manage toggling between xdebug and opcache in a separate script.