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 驱动学习 环境部署中的问题
  • ¥15 【急】在线问答CNC雕刻机的电子电路与编程
  • ¥60 在mc68335芯片上移植ucos ii 的成功工程文件
  • ¥15 笔记本外接显示器正常,但是笔记本屏幕黑屏
  • ¥15 Python pandas
  • ¥15 蓝牙硬件,可以用哪几种方法控制手机点击和滑动
  • ¥15 生物医学数据分析。基础课程就v经常唱课程舅成牛逼
  • ¥15 云环境云开发云函数对接微信商户中的分账功能
  • ¥15 空间转录组CRAD遇到问题
  • ¥20 materialstudio计算氢键脚本问题