Search code examples
phphomebrewxdebugosx-elcapitan

Install xdebug on El Capitan with homebrew


Dumb question I think, but I have PHP 5.6.14 running on El Capitan.

I have installed xdebug with

brew install php56-xdebug

But there is no mention of xdebug in phpinfo

phpinfo reveals:

Configuration File (php.ini) Path:  /etc

When I run brew install php56-xdebug again, I get

homebrew/php/php56-xdebug-2.3.3 already installed

So I'm guessing that brew has installed xdebug on a path (where?) which is for a different version of PHP which I'm not actually running.

Can somebody help me understand what brew has done, and how I can configure the version of PHP that I'm running to include xdebug.


Solution

  • OK, so I fixed this. Any comments welcome on whether I did it right.

    1) Found where the brew install of php is using

    brew info php56
    

    This reports:

    To enable PHP in Apache add the following to httpd.conf and restart Apache:

    LoadModule php5_module /usr/local/opt/php56/libexec/apache2/libphp5.so

    Update version of php loaded by apache:

    sudo nano /etc/apache2/httpd.conf
    

    Replaced

    LoadModule php5_module libexec/apache2/libphp5.so
    

    with

    LoadModule php5_module /usr/local/opt/php56/libexec/apache2/libphp5.so