4

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

Mondy
  • 2,055
  • 4
  • 19
  • 29
  • My PHP.INI is located at /etc/php.ini Into php.ini I added:

    [xdebug]
    zend_extension="/usr/lib/php/extensions/no-debug-non-zts-20160303/xdebug.so"

    xdebug.remote_enable=true
    xdebug.remote_host=localhost
    xdebug.remote_port=9000
    xdebug.remote_handler=dbgp

    xdebug.var_display_max_children=-1
    xdebug.var_display_max_data=-1
    xdebug.var_display_max_depth=-1

    After restarting I can't find xdebug into php info.
    – Mondy Oct 09 '17 at 06:59
  • Find an answer here: https://stackoverflow.com/questions/46593880/xdebug-on-macos-10-13-with-php-7?rq=1 – Mondy Oct 09 '17 at 18:29

2 Answers2

4

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>
    
AamirR
  • 11,672
  • 4
  • 59
  • 73
0

The solution:

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

Then I copied xdebug.so into my extension directory.

Mondy
  • 2,055
  • 4
  • 19
  • 29
  • I'm running into the same problem. Could you explain in more depth what did you do to solve it ? What exactly the command above will do ? – delphirules Oct 18 '17 at 12:04