How to use xdebug with MAC High Sierra standard installation

Viewed 1649

I reinstalled my macbook with High Sierra (10.13). It contains Apache/2.4.27 and PHP 7.1.7.

Now I want to activate xdebug. Please can someone give me some informations, how to do it?

Thanks for help

2 Answers

Xdebug altogether with PHP 7.1 comes preinstalled on High Sierra (OS X 10.13.5), you just need to enable it, to do so, paste following in \etc\php.ini

[xdebug]
zend_extension="/usr/lib/php/extensions/no-debug-non-zts-20160303/xdebug.so"
xdebug.idekey="netbeans-xdebug"
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.overload_var_dump=0

Note: you might have to create a php.ini file by duplicating/renaming this file \etc\php.ini.default


In addition to above you might also need to edit \etc\apache2\httpd.conf with following changes:

  1. Uncomment this line

    LoadModule php7_module libexec/apache2/libphp7.so
    
  2. Paste following at the end

    <IfModule php7_module>
        AddType application/x-httpd-php .php
        AddType application/x-httpd-php-source .phps
    
        <IfModule dir_module>
            DirectoryIndex index.html index.php
        </IfModule>
    </IfModule>
    

The solution:

curl -s http://php-osx.liip.ch/install.sh | bash -s 7.1

Then I copied xdebug.so into my extension directory.

Related