Search code examples
pearmacportspeclmacos-mojavephp-7.3

How to install pear/pecl/xdebug for php using macports


I have a PHP setup using macports, on MacOS Mojave. I have just upgraded from 5.6 to 7.3; everything is working fine except that I need xdebug, which requires pecl, which requires pear, and I don't have a working copy of pear any more.

I've found several answers which work using homebrew, but that would mean uninstalling large amounts of stuff and reinstalling them with homebrew, which I'd rather not do if I don't have to.

Various other solutions mentioned in other posts don't work any more because http://pear.php.net/ is down indefinitely. I can find their github site but I can't quite see what to do from there, since their INSTALL file has no instructions for mac.

Any ideas?


Solution

  • If php 7.2 is sufficient, MacPorts has a port for php72-xdebug. You can install it with

    sudo port install php72-xdebug

    If you really want 7.3 support, you might ping the maintainer for those packages. There are php73-xxx versions of a number of ports. He hasn't gotten to xdebug at the moment.

    More generally, use MacPorts search facility to check for packages you are interested in. For example, enter the following command in Terminal:

    port search xdebug

    A similar search can be performed on the website, on the Available Ports page:

    https://www.macports.org/ports.php