如何在PHP 7.1.14中安装xdebug PHP扩展,它安装在osx high sierra上?

时间:2018-02-15 09:44:47

标签: php macos docker

以下是mac上的php安装版本详细信息:

 php -v PHP 7.1.14 (cli) (built: Feb  2 2018 08:41:46) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies
    with Xdebug v2.6.0, Copyright (c) 2002-2018, by Derick Rethans

在mac上获取有关已安装版本问题的错误:

pecl/xdebug requires PHP (version >= 7.0.0), installed version is 5.6.28
No valid packages found
install failed

2 个答案:

答案 0 :(得分:0)

复制您的phpinfo()输出,无论是命令行还是输出的页面源。并将其粘贴到textarea here中。您将获得自定义安装说明。

答案 1 :(得分:0)

RUN apt update \
&& apt-get install -y apt-utils locales software-properties-common \
&& locale-gen en_US.UTF-8 \
&& update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8

RUN LC_ALL=C.UTF-8 add-apt-repository -y ppa:ondrej/php \
&& apt update \
&& apt install -y curl git unzip ntp imagemagick \
    php7.1-fpm php7.1-cli php7.1-fpm php7.1-dev php7.1-gd \
    php7.1-curl php7.1-mbstring php7.1-soap php7.1-xml php7.1-readline \
    php7.1-zip php7.1-intl php7.1-pgsql php-imagick php-xdebug \
&& mkdir /run/php \
&& phpdismod -s cli xdebug

RUN sed -i "s/error_reporting = .*/error_reporting = E_ALL/" /etc/php/7.1/cli/php.ini \
&& sed -i "s/display_errors = .*/display_errors = On/" /etc/php/7.1/cli/php.ini \
&& sed -i "s/memory_limit = .*/memory_limit = 512M/" /etc/php/7.1/cli/php.ini \
&& sed -i "s/;date.timezone.*/date.timezone = UTC/" /etc/php/7.1/cli/php.ini \
&& sed -i "s/error_reporting = .*/error_reporting = E_ALL/" /etc/php/7.1/fpm/php.ini \
&& sed -i "s/display_errors = .*/display_errors = On/" /etc/php/7.1/fpm/php.ini \
&& sed -i "s/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/" /etc/php/7.1/fpm/php.ini \
&& sed -i "s/memory_limit = .*/memory_limit = 512M/" /etc/php/7.1/fpm/php.ini \
&& sed -i "s/upload_max_filesize = .*/upload_max_filesize = 100M/" /etc/php/7.1/fpm/php.ini \
&& sed -i "s/post_max_size = .*/post_max_size = 100M/" /etc/php/7.1/fpm/php.ini \
&& sed -i "s/;date.timezone.*/date.timezone = UTC/" /etc/php/7.1/fpm/php.ini \
&& sed -i "s/;daemonize = yes/daemonize = no/" /etc/php/7.1/fpm/php-fpm.conf \
&& sed -i "s/listen = .*/listen = 0.0.0.0:9000/" /etc/php/7.1/fpm/pool.d/www.conf