简体   繁体   中英

I can't get xdebug.remote_port to change

I have Mac OSX El Capitan. I recently upgraded from Yosemite, which ended up messing up a lot of test environments because it replaced the httpd.conf file. I have everything pretty much up and running but I can't get my xdebug to work with my IDE. I got xdebug and php through a brew install. I'm running PHP 5.5.30. When I look in the php.ini file and the ext-debug.ini the only configs for xdbeug I've found are:

[xdebug]
zend_extension="/usr/local/opt/php55-xdebug/xdebug.so"
xdebug.remote_autostart=on
xdebug.remote_enable=on
xdebug.remote_handler="dbgp"
xdebug.remote_port = 9000
;xdebug.remote_connect_back=on
xdebug.remote_host = 127.0.0.1
xdebug.profiler_enable = on
xdebug.profiler_enable_trigger_ on
xdebug.profiler_output_name = cachegrind.out.%t.%p
xdebug.remote_mode=req
xdebug.idekey="netbeans-xdebug"

I can change any of the settings, restart apache, and the changes will display in a page where I call phpinfo() except for the xdebug.remote_port. As you can see I have that set to 9000, but it doesn't matter when I pull the page with the phpinfo() on it it always says it is on port 1000. I'm using Netbeans IDE and I've tried changing this to port 1000, but Netbeans always complains that this port is occupied. When I run netstat -anp tcp | grep 1000 it comes up with nothing so I'm not sure why it is saying it is occupied. So my problem is I can't change the remote_port to 9000 and I can't change Netbeans to listen on 10000.

I've also tried running sudo grep -rnw '/' -e "xdebug.remote_port" to try to see if I can find another file this parameter may be being set in that which overriding the setting of it to port 9000, but so far haven't come up with anything yet. Has anyone else had this problem and can help me figure it out?

Ok I figured it out. I looked at the the page displayed by phpinfo() and found all the parsed ini files. I found a file that was setting the port to 1000. I erased it so that only one ini file had the xdebug settings on it and the changes took effect.

xdebug still didn't work but found this link http://www.devside.net/wamp-server/netbeans-waiting-for-connection-netbeans-xdebug-issue

I wasn't using a WAMP stack but the article gave good troubleshooting tips.

and found that another service was listening on port 9000. I changed the port to 8000 in both NetBeans and the ini files which was empty and xdebug works correctly now.

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