Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/229.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
xdebug extenstion不随php:5.6-apache一起安装_Php_Docker Compose_Dockerfile_Xdebug - Fatal编程技术网

xdebug extenstion不随php:5.6-apache一起安装

xdebug extenstion不随php:5.6-apache一起安装,php,docker-compose,dockerfile,xdebug,Php,Docker Compose,Dockerfile,Xdebug,我试图将xdebug安装到我的dockerfile版本中,但它没有以php:5.6-apache作为基础映像进行安装 它返回以下消息 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 这是我的do

我试图将xdebug安装到我的dockerfile版本中,但它没有以php:5.6-apache作为基础映像进行安装

它返回以下消息

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

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
您是否需要以下信息取决于您的确切用法。但我会把它包括在内,这样你就可以尝试一下了

巴什尔先生

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

参见

你好,乔治。感谢您的帮助,但它没有工作,返回以下错误;检查支持的PHP版本。。。配置:错误:不支持。需要PHP版本>=7.0.0和<7.3.0(找到5.6.40)啊抱歉,请尝试其他标签版本。我将把问题从2.6.1编辑到2.5.5,因为我相信这是支持PHP5.6hi的最新版本。它仍然显示一个错误:错误:pathspec“tags/2.5.5”与git已知的任何文件都不匹配。抱歉,看起来他们最近更改了标记的格式,这里有一个新的OneHanks MATE。它起作用了