Xdebug extenstion does not install with php:5.6-apache

i am trying to install xdebug into my dockerfile build but it does not install with php:5.6-apache as the base image.

it returns the following message;

ERROR: Service 'php' failed to build: The command '/bin/sh -c apt-get update && apt-get install -y   ...  
&& pecl install xdebug   returned a non-zero code: 1

this is my dockerfile:

FROM php:5.6-apache

ENV S6_OVERLAY_VERSION 1.11.0.1


RUN tar xzf /tmp/s6-overlay-amd64.tar.gz -C /

RUN apt-get update && apt-get install -y \
    libldap2-dev \
    --no-install-recommends \
    && rm -r /var/lib/apt/lists/* \
    && docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu/ \
    && docker-php-ext-install ldap \
     && pecl install xdebug \
    && docker-php-ext-install mysqli pdo pdo_mysql

RUN a2enmod rewrite

COPY ./docker/rootfs /
COPY . /app

WORKDIR /app

ENTRYPOINT ["/init"]

How can I install xedbug with PHP5

1 Like

I have the same problem.
I saw the was error about.

pecl/xdebug requires PHP (version >= 7.1.0), installed version is 5.6.40
No valid packages found
install failed
ERROR: Service ‘apache’ failed to build: The command ‘/bin/sh -c apt-get update && pecl install xdebug’ returned a non-zero code: 1
max@maxpc:~/PHPShopCms/public$ docker-compose up --build

I decided to install version 7.1.