Skip to content

Instantly share code, notes, and snippets.

@mingalevme
Last active December 20, 2022 08:48
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 mingalevme/d834e74ebb8c71fc5b938222acc98438 to your computer and use it in GitHub Desktop.
Save mingalevme/d834e74ebb8c71fc5b938222acc98438 to your computer and use it in GitHub Desktop.
PHP 5.4 Docker + Xdebug + Composer
FROM php:5.4
RUN apt-get update && apt-get upgrade -y
RUN apt-get install -y zlib1g-dev libzip-dev unzip && \
curl --insecure "https://getcomposer.org/download/latest-2.2.x/composer.phar" > "/usr/local/bin/composer" && \
chmod a+x "/usr/local/bin/composer" && \
cd /opt && \
curl --insecure -O https://xdebug.org/files/xdebug-2.4.1.tgz && \
tar -xvf xdebug-2.4.1.tgz && \
cd xdebug-2.4.1 && \
phpize && \
./configure --enable-xdebug && \
make && \
make install && \
echo "zend_extension=/usr/local/lib/php/extensions/no-debug-non-zts-20100525/xdebug.so" > /usr/local/etc/php/conf.d/xdebug.ini
FROM php:7.4-fpm
RUN apt-get update && apt-get upgrade -y
RUN curl --insecure "https://getcomposer.org/download/2.4.4/composer.phar" > "/usr/local/bin/composer" && \
chmod a+x "/usr/local/bin/composer" && \
cd /opt && \
curl --insecure -O https://xdebug.org/files/xdebug-3.1.6.tgz && \
tar -xvf xdebug-3.1.6.tgz && \
cd xdebug-3.1.6 && \
phpize && \
./configure --enable-xdebug && \
make && \
make install && \
echo "zend_extension=/usr/local/lib/php/extensions/no-debug-non-zts-20190902/xdebug.so" > /usr/local/etc/php/conf.d/xdebug.ini
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment