使用 Homebrew 在 OSX 上为 PHP 5.6 安装 Xdebug
Install Xdebug for PHP 5.6 on OSX with Homebrew
homebrew/php 点击是 recently deprecated。此弃用包括 php 安装的版本化公式(例如 php56
)以及单个扩展的安装(例如 php56-xdebug
)。
使用 Homebrew 安装 PHP 5.6 现在需要命令:brew install php@5.6
.
安装 PHP 5.6 然后 运行 phpinfo()
表示 Xdebug 未加载到扩展列表中,并且未找到调试器扩展。输出的选择性副本如下:
$ /usr/local/Cellar/php\@5.6/5.6.35/bin/php -r "phpinfo();"
PHP Version => 5.6.35
System => Darwin [my hostname] 17.4.0 Darwin Kernel Version 17.4.0: Sun Dec 17 09:19:54 PST 2017; root:xnu-4570.41.2~1/RELEASE_X86_64 x86_64
Build Date => Mar 31 2018 20:19:57
Configure Command => './configure' '--prefix=/usr/local/Cellar/php@5.6/5.6.35' '--localstatedir=/usr/local/var' '--sysconfdir=/usr/local/etc/php/5.6' '--with-config-file-path=/usr/local/etc/php/5.6' '--with-config-file-scan-dir=/usr/local/etc/php/5.6/conf.d' '--enable-bcmath' '--enable-calendar' '--enable-dba' '--enable-exif' '--enable-ftp' '--enable-fpm' '--enable-intl' '--enable-mbregex' '--enable-mbstring' '--enable-mysqlnd' '--enable-opcache-file' '--enable-pcntl' '--enable-phpdbg' '--enable-phpdbg-webhelper' '--enable-shmop' '--enable-soap' '--enable-sockets' '--enable-sysvmsg' '--enable-sysvsem' '--enable-sysvshm' '--enable-wddx' '--enable-zip' '--with-apxs2=/usr/local/opt/httpd/bin/apxs' '--with-bz2' '--with-fpm-user=_www' '--with-fpm-group=_www' '--with-freetype-dir=/usr/local/opt/freetype' '--with-gd' '--with-gettext=/usr/local/opt/gettext' '--with-gmp=/usr/local/opt/gmp' '--with-icu-dir=/usr/local/opt/icu4c' '--with-jpeg-dir=/usr/local/opt/jpeg' '--with-kerberos' '--with-layout=GNU' '--with-ldap' '--with-ldap-sasl' '--with-libedit' '--with-libzip' '--with-mhash' '--with-mysql-sock=/tmp/mysql.sock' '--with-mysqli=mysqlnd' '--with-mysql=mysqlnd' '--with-mcrypt=/usr/local/opt/mcrypt' '--with-ndbm' '--with-openssl=/usr/local/opt/openssl' '--with-pdo-dblib=/usr/local/opt/freetds' '--with-pdo-mysql=mysqlnd' '--with-pdo-odbc=unixODBC,/usr/local/opt/unixodbc' '--with-pdo-pgsql=/usr/local/opt/libpq' '--with-pgsql=/usr/local/opt/libpq' '--with-pic' '--with-png-dir=/usr/local/opt/libpng' '--with-pspell=/usr/local/opt/aspell' '--with-unixODBC=/usr/local/opt/unixodbc' '--with-webp-dir=/usr/local/opt/webp' '--with-xmlrpc' '--with-xsl' '--with-zlib' '--with-curl' 'CC=clang' 'CPPFLAGS=-DU_USING_ICU_NAMESPACE=1' 'CXX=clang++'
Server API => Command Line Interface
Virtual Directory Support => disabled
Configuration File (php.ini) Path => /usr/local/etc/php/5.6
Loaded Configuration File => /usr/local/etc/php/5.6/php.ini
Scan this dir for additional .ini files => /usr/local/etc/php/5.6/conf.d
Additional .ini files parsed => /usr/local/etc/php/5.6/conf.d/ext-opcache.ini
...
...
运行 brew options php
和 brew options php@5.6
不提供有关在自制程序安装过程中安装其他扩展的选项的信息。 brew search xdebug
没有产生感兴趣的包。
据我所知,默认情况下没有安装 Xdebug,目前没有任何机制可以使用自制软件和这个新的通用 php
公式来安装 Xdebug。
既然原来的 homebrew/php
tap 已被弃用,有人知道如何以合理的方式安装 Xdebug 吗?
根据this answer,可以用pecl install xdebug
安装。但是,较新版本的 xdebug 已放弃对 PHP 5.6 的支持。要安装支持 php 5.6 的旧版本 xdebug,请使用 pecl install xdebug-2.5.5
我找到了使用已弃用的 homebrew/php 来安装 php56 扩展的解决方案。
希望对你有所帮助
homebrew/php 点击是 recently deprecated。此弃用包括 php 安装的版本化公式(例如 php56
)以及单个扩展的安装(例如 php56-xdebug
)。
使用 Homebrew 安装 PHP 5.6 现在需要命令:brew install php@5.6
.
安装 PHP 5.6 然后 运行 phpinfo()
表示 Xdebug 未加载到扩展列表中,并且未找到调试器扩展。输出的选择性副本如下:
$ /usr/local/Cellar/php\@5.6/5.6.35/bin/php -r "phpinfo();"
PHP Version => 5.6.35
System => Darwin [my hostname] 17.4.0 Darwin Kernel Version 17.4.0: Sun Dec 17 09:19:54 PST 2017; root:xnu-4570.41.2~1/RELEASE_X86_64 x86_64
Build Date => Mar 31 2018 20:19:57
Configure Command => './configure' '--prefix=/usr/local/Cellar/php@5.6/5.6.35' '--localstatedir=/usr/local/var' '--sysconfdir=/usr/local/etc/php/5.6' '--with-config-file-path=/usr/local/etc/php/5.6' '--with-config-file-scan-dir=/usr/local/etc/php/5.6/conf.d' '--enable-bcmath' '--enable-calendar' '--enable-dba' '--enable-exif' '--enable-ftp' '--enable-fpm' '--enable-intl' '--enable-mbregex' '--enable-mbstring' '--enable-mysqlnd' '--enable-opcache-file' '--enable-pcntl' '--enable-phpdbg' '--enable-phpdbg-webhelper' '--enable-shmop' '--enable-soap' '--enable-sockets' '--enable-sysvmsg' '--enable-sysvsem' '--enable-sysvshm' '--enable-wddx' '--enable-zip' '--with-apxs2=/usr/local/opt/httpd/bin/apxs' '--with-bz2' '--with-fpm-user=_www' '--with-fpm-group=_www' '--with-freetype-dir=/usr/local/opt/freetype' '--with-gd' '--with-gettext=/usr/local/opt/gettext' '--with-gmp=/usr/local/opt/gmp' '--with-icu-dir=/usr/local/opt/icu4c' '--with-jpeg-dir=/usr/local/opt/jpeg' '--with-kerberos' '--with-layout=GNU' '--with-ldap' '--with-ldap-sasl' '--with-libedit' '--with-libzip' '--with-mhash' '--with-mysql-sock=/tmp/mysql.sock' '--with-mysqli=mysqlnd' '--with-mysql=mysqlnd' '--with-mcrypt=/usr/local/opt/mcrypt' '--with-ndbm' '--with-openssl=/usr/local/opt/openssl' '--with-pdo-dblib=/usr/local/opt/freetds' '--with-pdo-mysql=mysqlnd' '--with-pdo-odbc=unixODBC,/usr/local/opt/unixodbc' '--with-pdo-pgsql=/usr/local/opt/libpq' '--with-pgsql=/usr/local/opt/libpq' '--with-pic' '--with-png-dir=/usr/local/opt/libpng' '--with-pspell=/usr/local/opt/aspell' '--with-unixODBC=/usr/local/opt/unixodbc' '--with-webp-dir=/usr/local/opt/webp' '--with-xmlrpc' '--with-xsl' '--with-zlib' '--with-curl' 'CC=clang' 'CPPFLAGS=-DU_USING_ICU_NAMESPACE=1' 'CXX=clang++'
Server API => Command Line Interface
Virtual Directory Support => disabled
Configuration File (php.ini) Path => /usr/local/etc/php/5.6
Loaded Configuration File => /usr/local/etc/php/5.6/php.ini
Scan this dir for additional .ini files => /usr/local/etc/php/5.6/conf.d
Additional .ini files parsed => /usr/local/etc/php/5.6/conf.d/ext-opcache.ini
...
...
运行 brew options php
和 brew options php@5.6
不提供有关在自制程序安装过程中安装其他扩展的选项的信息。 brew search xdebug
没有产生感兴趣的包。
据我所知,默认情况下没有安装 Xdebug,目前没有任何机制可以使用自制软件和这个新的通用 php
公式来安装 Xdebug。
既然原来的 homebrew/php
tap 已被弃用,有人知道如何以合理的方式安装 Xdebug 吗?
根据this answer,可以用pecl install xdebug
安装。但是,较新版本的 xdebug 已放弃对 PHP 5.6 的支持。要安装支持 php 5.6 的旧版本 xdebug,请使用 pecl install xdebug-2.5.5
我找到了使用已弃用的 homebrew/php 来安装 php56 扩展的解决方案。
希望对你有所帮助