[英]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.我正在尝试将 xdebug 安装到我的 dockerfile 版本中,但它没有使用 php:5.6-apache 作为基本映像进行安装。
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:这是我的 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如何使用 PHP5 安装 xedbug
Dockerfile文件
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
Whether you need the below or not depends on your exact usage.您是否需要以下内容取决于您的确切用法。 But I'll include it anyway so you can try things out.
但无论如何我都会包括它,以便您可以尝试一下。
.bashrc .bashrc
export PHP_IDE_CONFIG="serverName=docker";
php.ini - where the ip should be your local machine for your docker network. php.ini - ip 应该是你的 docker 网络的本地机器。 The log is there just to help you debug if the install doesn't work.
如果安装不起作用,日志只是为了帮助您调试。
xdebug.remote_host=172.20.0.1
xdebug.idekey="PHPSTORM"
xdebug.remote_log=/srv/www/var/log/xdebug.log
The accepted answer assumes git
is installed in your container.接受的答案假定
git
安装在您的容器中。 I think this is the "more correct" way to install a specific version of xdebug:我认为这是安装特定版本的 xdebug 的“更正确”的方法:
RUN apk add --no-cache $PHPIZE_DEPS \
&& pecl install xdebug-2.5.5 \
&& docker-php-ext-enable xdebug
cf.参见https://stackoverflow.com/a/46831699/2105015
https://stackoverflow.com/a/46831699/2105015
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.