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

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

图片转代码服务由CSDN问答提供 功能建议

我正在尝试将xdebug安装到我的dockerfile构建中,但它不会安装php:5.6-apache作为基础 image。

它返回以下消息;

 错误:服务'php'无法构建:命令'/ bin / sh -c apt-get update&&  apt-get install -y ... 
&&  pecl install xdebug返回一个非零代码: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-recommended \
&&  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重写
 
COPY ./docker/rootfs / 
COPY。  / app 
 
WORKDIR / app 
 
ENTRYPOINT [“/ init”] 
   
 
 

如何使用PHP5安装xedbug

  • 写回答
  • 好问题 提建议
  • 关注问题
  • 收藏
  • 邀请回答

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
    
    已采纳该答案
    评论
    解决 无用
    打赏 举报

相关推荐 更多相似问题