duanshan188866 2019-03-18 08:55
浏览 798
已采纳

xdebug扩展无法安装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条回答 默认 最新

  • duanjiushu5063 2019-03-18 09:27
    关注

    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

    export PHP_IDE_CONFIG="serverName=docker";
    

    php.ini - where the ip should be your local machine for your docker network. 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
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 sub地址DHCP问题
  • ¥15 delta降尺度计算的一些细节,有偿
  • ¥15 Arduino红外遥控代码有问题
  • ¥15 数值计算离散正交多项式
  • ¥30 数值计算均差系数编程
  • ¥15 redis-full-check比较 两个集群的数据出错
  • ¥15 Matlab编程问题
  • ¥15 训练的多模态特征融合模型准确度很低怎么办
  • ¥15 kylin启动报错log4j类冲突
  • ¥15 超声波模块测距控制点灯,灯的闪烁很不稳定,经过调试发现测的距离偏大