简体   繁体   中英

Xdebug in PHP does not stop at breakpoint in intelliJ Idea

Environment OS X El Capitan

➜  ~  php --version
PHP 5.3.29 (cli) (built: Nov 16 2015 16:28:23)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2014 Zend Technologies
    with Xdebug v2.2.6, Copyright (c) 2002-2014, by Derick Rethans

IntelliJ IDE 13 setup

在此处输入图片说明

phpinfo();

在此处输入图片说明 在此处输入图片说明 listen to requests 在此处输入图片说明 在此处输入图片说明

The same setup used to work well (just hit the php url in browser and control stops at the break point of the code) but stopped working after I had to reinstall php53 using homebrew.

What could have could have gone wrong. Now var_dump() is the only way it seems.

After a month of trial and error, it looks like the webserver was not listening to port 9000. I change the port to 9090 both at ext-xdebug.ini and IDE preference and restarted apache, it worked !

➜  ~   sudo lsof -i :9090
COMMAND   PID    USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME
httpd   20822  daemon   22u  IPv4 0xead9c592a7139c1b      0t0  TCP localhost:49428->localhost:websm (CLOSED)
httpd   20822  daemon   23u  IPv4 0xead9c592ab5b9fbb      0t0  TCP localhost:49438->localhost:websm (CLOSED)
httpd   20822  daemon   26u  IPv4 0xead9c592aab3517b      0t0  TCP localhost:49436->localhost:websm (CLOSED)
httpd   20822  daemon   27u  IPv4 0xead9c592aa9224fb      0t0  TCP localhost:49440->localhost:websm (CLOSED)
httpd   20824  daemon   22u  IPv4 0xead9c592ab6406db      0t0  TCP localhost:49472->localhost:websm (CLOSED)
httpd   20824  daemon   23u  IPv4 0xead9c592ab640fbb      0t0  TCP localhost:49473->localhost:websm (CLOSED)
idea    21828 user1  287u  IPv4 0xead9c592afc6e33b      0t0  TCP *:websm (LISTEN)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM