V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
570956418
V2EX  ›  Docker

docker 安装 sdebug 遇到了问题

  •  
  •   570956418 · 2020-12-04 15:17:38 +08:00 · 1075 次点击
    这是一个创建于 1210 天前的主题,其中的信息可能已经有所发展或是发生改变。

    介绍

    dnmp 开发环境 用的 swoole4.5,安装 sdebug 进行调试,网上找了个教程,教程链接,我之前已经安装了 dnmp 环境,我是直接从 sdebug 处开始安装的,安装 buildPHP 出错,请问这是哪里错了?

    错误内容:

    	ERROR: Service 'php' failed to build : The command '/bin/sh -c cd /tmp/sdebug     && phpize     && ./configure --enable-xdebug     && make     && make install     && docker-php-ext-enable xdebug     && php -m     && php --ri sdebug' returned a non-zero code: 1
    
    	COPY ./swoole-4.5.3.tgz /tmp/swoole.tgz
    
    RUN mkdir -p /tmp/swoole \
    && tar -xf /tmp/swoole.tgz -C /tmp/swoole --strip-components=1 \
    && rm /tmp/swoole.tgz \
    && docker-php-ext-configure /tmp/swoole \
    && docker-php-ext-install /tmp/swoole \
    && rm -r /tmp/swoole
    
    COPY ./sdebug /tmp/sdebug
    
    # install sdebug
    # 运行克隆前,先把目录切换到 /tmp,避免以前的命令致使目录错误
    RUN cd /tmp/sdebug \
        && phpize \
        && ./configure --enable-xdebug \
        && make \
        && make install \
        && docker-php-ext-enable xdebug \
        && php -m \
        && php --ri sdebug
    
    # config php
    RUN cd /usr/local/etc/php/conf.d \
        # swoole config
        # 关闭 swoole 短名称,使用 Hyperf 这个是必需要
        && echo "swoole.use_shortname = off" >> 99-off-swoole-shortname.ini \
        # config xdebug
        && { \
            # 添加一个 Xdebug 节点
            echo "[Xdebug]"; \
            # 启用远程链接
            echo "xdebug.remote_enable = 1"; \
            # 这个是多人调试,可是如今有些困难,就暂时不启动
            echo ";xdebug.remote_connect_back = On"; \
            # 自动启动远程调试
            echo "xdebug.remote_autostart  = true"; \
            # 这里 host 能够填前面取到的 IP,也能够填写 host.docker.internal 。
            echo "xdebug.remote_host = host.docker.internal"; \
            # 这里端口固定填写 19000,固然能够填写其余的,须要保证没有被占用
            echo "xdebug.remote_port = 19000"; \
            # 这里固定便可
            echo "xdebug.idekey=PHPSTORM"; \
            # 把执行结果保存到 99-xdebug-enable.ini 里面去
        } | tee 99-xdebug-enable.ini
    
    
    WORKDIR /www
    
    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1478 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 23:50 · PVG 07:50 · LAX 16:50 · JFK 19:50
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.