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
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!
  • ¥15 drone 推送镜像时候 purge: true 推送完毕后没有删除对应的镜像,手动拷贝到服务器执行结果正确在样才能让指令自动执行成功删除对应镜像,如何解决?
  • ¥15 求daily translation(DT)偏差订正方法的代码
  • ¥15 js调用html页面需要隐藏某个按钮
  • ¥15 ads仿真结果在圆图上是怎么读数的
  • ¥20 Cotex M3的调试和程序执行方式是什么样的?
  • ¥20 java项目连接sqlserver时报ssl相关错误
  • ¥15 一道python难题3