xdebug 扩展不与 php:5.6-apache 一起安装
xdebug extenstion does not install with php:5.6-apache
我正在尝试将 xdebug 安装到我的 dockerfile 构建中,但它没有使用 php:5.6-apache 作为基础映像进行安装。
它returns下面的消息;
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
这是我的 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"]
如何使用 PHP5
安装 xedbug
Docker 文件
RUN git clone https://github.com/xdebug/xdebug.git \
&& cd xdebug \
&& git checkout tags/XDEBUG_2_5_5 \
&& phpize \
&& ./configure --enable-xdebug \
&& make \
&& make install
是否需要以下内容取决于您的具体用途。但我还是会把它包括在内,这样你就可以尝试一下。
.bashrc
export PHP_IDE_CONFIG="serverName=docker";
php.ini - IP 应该是您 docker 网络的本地机器。如果安装不起作用,日志只是为了帮助您调试。
xdebug.remote_host=172.20.0.1
xdebug.idekey="PHPSTORM"
xdebug.remote_log=/srv/www/var/log/xdebug.log
接受的答案假定 git
安装在您的容器中。我认为这是安装特定版本 xdebug 的“更正确”方法:
RUN apk add --no-cache $PHPIZE_DEPS \
&& pecl install xdebug-2.5.5 \
&& docker-php-ext-enable xdebug
比照。
我正在尝试将 xdebug 安装到我的 dockerfile 构建中,但它没有使用 php:5.6-apache 作为基础映像进行安装。
它returns下面的消息;
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
这是我的 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"]
如何使用 PHP5
安装 xedbugDocker 文件
RUN git clone https://github.com/xdebug/xdebug.git \
&& cd xdebug \
&& git checkout tags/XDEBUG_2_5_5 \
&& phpize \
&& ./configure --enable-xdebug \
&& make \
&& make install
是否需要以下内容取决于您的具体用途。但我还是会把它包括在内,这样你就可以尝试一下。
.bashrc
export PHP_IDE_CONFIG="serverName=docker";
php.ini - IP 应该是您 docker 网络的本地机器。如果安装不起作用,日志只是为了帮助您调试。
xdebug.remote_host=172.20.0.1
xdebug.idekey="PHPSTORM"
xdebug.remote_log=/srv/www/var/log/xdebug.log
接受的答案假定 git
安装在您的容器中。我认为这是安装特定版本 xdebug 的“更正确”方法:
RUN apk add --no-cache $PHPIZE_DEPS \
&& pecl install xdebug-2.5.5 \
&& docker-php-ext-enable xdebug
比照。