13

The homebrew/php tap was recently deprecated. This deprecation included versioned formulae for php installations (e.g., php56) as well as installation of individual extensions (e.g., php56-xdebug).

Installing PHP 5.6 with Homebrew now requires the command: brew install php@5.6.

Installing PHP 5.6 and then running phpinfo() indicates that Xdebug is not loaded in the list of extensions, and a debugger extension is not found. A selective copy of the output is as follows:

$ /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

...
...

Running brew options php and brew options php@5.6 yield no information on options to install additional extensions in the homebrew installation process. brew search xdebug yields no packages of interest.

As far as I can tell, Xdebug is not installed by default, and there is currently no mechanism to install Xdebug using homebrew with this new generic php formula.

Does anybody know how to go about installing Xdebug in a sensible way now that the original homebrew/php tap has been deprecated?

2 Answers 2

23

According to this answer, you can install it with pecl install xdebug. However, newer versions of xdebug have dropped support for PHP 5.6. To install an older version of xdebug with support for php 5.6, use pecl install xdebug-2.5.5

4
  • 4
    Thanks for the suggestion. I gave it a crack however it complains that the pecl/xdebug package requires PHP >=7.0.0: cosmo:~ pcc$ pecl install xdebug pecl/xdebug requires PHP (version >= 7.0.0), installed version is 5.6.35 No valid packages found install failed I have ensured that I'm running the correct version of PHP (in the past I had two versions on, so I've run brew unlink php55 && brew unlink php71 && brew link php@5.6 to be sure) but it complains with the same failure. I'm looking around to see if there's a way to avoid this error now.
    – Vector
    Apr 5, 2018 at 13:07
  • 14
    According to the xdebug PECL changelog, the PECL package dropped support for PHP 5.6 after version 2.5.5. Performing an install with pecl install xdebug-2.5.5 seems to have done the trick, and I can now debug PHP sessions with my IDE. Thank you for your help!
    – Vector
    Apr 5, 2018 at 13:22
  • Happy to help ! Thanks for the feedback, this might help for some future PHP 5.6 development.
    – Scentle5S
    Apr 5, 2018 at 23:53
  • 1
    Real life saver there! Jun 12, 2019 at 23:53
3

I've found a solution to use the deprecated homebrew/php to install php56-extensions.

Install PHP Extension for PHP 5.6 on OSX with deprecated homebrew/php

I hope I've helped you

2
  • Hi, thanks for taking the time to help me out! That definitely looks like a working solution: nicely done. I'm hoping to try and come up with something that will work long term (particularly with updates) that doesn't require manual intervention beyond performing a standard brew update, but this is a great fallback position if that can't be done. Thank you!
    – Vector
    Apr 5, 2018 at 13:13
  • Hi, I see that homebrew/core it is updated very often. I think that in little time, also all PHP extensions will be inserted to use an standard installation process.
    – Giampaolo
    Apr 5, 2018 at 16:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.