Skip to content

Instantly share code, notes, and snippets.

@rfay
Created May 10, 2022 01:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rfay/4af2f76d332fb8a812f95e5538c4d4f9 to your computer and use it in GitHub Desktop.
Save rfay/4af2f76d332fb8a812f95e5538c4d4f9 to your computer and use it in GitHub Desktop.
DDEV: Build xdebug from scratch
ARG BASE_IMAGE
FROM $BASE_IMAGE
ENV PHP_TAG=7.4.29
# May want to install php7.4-dev to find out config arguments with `php-config`
#RUN git clone https://github.com/php/php-src.git && cd php-src && git checkout php-$PHP_TAG && ./buildconf --force
#RUN ./configure --includedir=/usr/include --mandir=/usr/share/man --infodir=/usr/share/info --disable-option-checking --disable-silent-rules --libdir=/usr/lib/x86_64-linux-gnu --libexecdir=/usr/lib/x86_64-linux-gnu --disable-maintainer-mode --disable-dependency-tracking --prefix=/usr --enable-cli --disable-cgi --disable-phpdbg --with-config-file-path=/etc/php/7.4/cli --with-config-file-scan-dir=/etc/php/7.4/cli/conf.d --build=x86_64-linux-gnu --host=x86_64-linux-gnu --config-cache --cache-file=/build/php7.4-7.4.29/config.cache --libdir=${prefix}/lib/php --libexecdir=${prefix}/lib/php --datadir=${prefix}/share/php/7.4 --program-suffix=7.4 --sysconfdir=/etc --localstatedir=/var --mandir=/usr/share/man --disable-all --disable-debug --disable-rpath --disable-static --with-pic --with-layout=GNU --without-pear --enable-filter --with-openssl --with-password-argon2=/usr --with-external-pcre --enable-hash --with-mhash=/usr --with-libxml --enable-session --with-sodium --with-system-tzdata --with-zlib=/usr --with-zlib-dir=/usr --enable-pcntl --with-libedit=shared
#RUN make -j 2
#RUN make install
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y -o Dpkg::Options::="--force-confold" --no-install-recommends --no-install-suggests build-essential autoconf libtool bison re2c pkg-config php7.4-dev
RUN git clone https://github.com/xdebug/xdebug && cd xdebug && phpize && ./configure --enable-xdebug
RUN cd /xdebug && make && make install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment