加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

如何在docker的官方php-fpm-alpine图像上安装XDebug?

发布时间:2020-12-16 03:44:44 所属栏目:安全 来源:网络整理
导读:我正在使用wordpress:php7.1-fpm-alpine,它基于php:7.1-fpm-alpine(https://github.com/docker-library/wordpress/blob/master/php7.1/fpm-alpine/Dockerfile). 我试过RUN pecl install xdebug-2.5.0 docker-php-ext-enable xdebug 这会在构建时导致错误:

我正在使用wordpress:php7.1-fpm-alpine,它基于php:7.1-fpm-alpine(https://github.com/docker-library/wordpress/blob/master/php7.1/fpm-alpine/Dockerfile).

我试过RUN pecl install xdebug-2.5.0&& docker-php-ext-enable xdebug

这会在构建时导致错误:

Step 19/19 : RUN pecl install xdebug-2.5.0     && docker-php-ext-enable xdebug
 ---> Running in 52c988e12cb2
downloading xdebug-2.5.0.tgz ...
Starting to download xdebug-2.5.0.tgz (267,640 bytes)
........................................................done: 267,640 bytes
76 source files,building
running: phpize
Configuring for:
PHP Api Version:         20160303
Zend Module Api No:      20160303
Zend Extension Api No:   320160303
Cannot find autoconf. Please check your autoconf installation and the
$PHP_AUTOCONF environment variable. Then,rerun this script.
以下内容足以简单地在该图像上安装xdebug:

FROM wordpress:php7.1-fpm-alpine

RUN apk add --no-cache $PHPIZE_DEPS 
    && pecl install xdebug-2.5.0 
    && docker-php-ext-enable xdebug

构建该结构然后从结果图像中的shell运行会产生以下结果:

$php -i | grep Xdebug
    with Xdebug v2.5.0,Copyright (c) 2002-2016,by Derick Rethans

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读