V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
shadow7
V2EX  ›  Docker

docker 安装 sdebug 遇到了问题

  •  
  •   shadow7 · Dec 4, 2020 · 1971 views
    This topic created in 1970 days ago, the information mentioned may be changed or developed.

    介绍

    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
    
    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1216 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 23:28 · PVG 07:28 · LAX 16:28 · JFK 19:28
    ♥ Do have faith in what you're doing.