2

I did 3 days of research and couldn't really solve my issue.

Here is my xdebug setting in php.ini

xdebug.idekey="netbeans-xdebug"
xdebug.remote_enable=1
xdebug.remote_host=127.0.0.1
xdebug.remote_connect_back=1    # Not safe for production servers
xdebug.remote_port=9000
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_autostart=true

My NetBeans run-configuration

One thing I notice writing this question was even when I'm debugging the port is always set to 8000 when I set it to 9000:

enter image description here

enter image description here

So I thought maybe NetBeans is pointing to a wrong php.ini ? I run phpinfo() in my test.php and it gave me this:

enter image description here

Now I'm totally lost. What should I do to make xdebug to work on NetBeans?

EDIT: I'm using internal web-server on NetBeans

EDIT: Things started to progress but now NetBeans give me this weird output:

"D:\bit_nami\php\php.exe" "-S" "localhost:9001"
[Tue Aug 08 02:42:38 2017] PHP Warning:  PHP Startup: Unable to load dynamic library 'D:\bit_nami\php\ext\php_pdo_firebird.dll' - 占쏙옙占쏙옙占쏙옙 占쏙옙占� 찾占쏙옙 占쏙옙 占쏙옙占쏙옙占싹댐옙.
 in Unknown on line 0
[Tue Aug 08 02:42:38 2017] PHP Warning:  PHP Startup: Unable to load dynamic library 'D:\bit_nami\php\ext\php_pdo_oci.dll' - 占쏙옙占쏙옙占쏙옙 占쏙옙占� 찾占쏙옙 占쏙옙 占쏙옙占쏙옙占싹댐옙.
 in Unknown on line 0
[Tue Aug 08 02:42:38 2017] PHP Warning:  Xdebug MUST be loaded as a Zend extension in Unknown on line 0
[Tue Aug 08 02:42:38 2017] PHP Warning:  Module 'xdebug' already loaded in Unknown on line 0
[Tue Aug 08 02:42:38 2017] Failed to listen on localhost:9001 (reason: 액세스 권한에 의해 숨겨진 소켓에 액세스를 시도했습니다.
)
<br />
<b>Warning</b>:  PHP Startup: Unable to load dynamic library 'D:\bit_nami\php\ext\php_pdo_firebird.dll' - 占쏙옙占쏙옙占쏙옙 占쏙옙占� 찾占쏙옙 占쏙옙 占쏙옙占쏙옙占싹댐옙.
 in <b>Unknown</b> on line <b>0</b><br />
<br />
<b>Warning</b>:  PHP Startup: Unable to load dynamic library 'D:\bit_nami\php\ext\php_pdo_oci.dll' - 占쏙옙占쏙옙占쏙옙 占쏙옙占� 찾占쏙옙 占쏙옙 占쏙옙占쏙옙占싹댐옙.
 in <b>Unknown</b> on line <b>0</b><br />
<br />
<b>Warning</b>:  Xdebug MUST be loaded as a Zend extension in <b>Unknown</b> on line <b>0</b><br />
<br />
<b>Warning</b>:  Module 'xdebug' already loaded in <b>Unknown</b> on line <b>0</b><br />
Done.
4
  • Do you use an apache or the internal webserver of netbeans? Commented Aug 8, 2017 at 6:30
  • powerpete - I'm using internal webserver on netbeans Commented Aug 8, 2017 at 6:43
  • Write zend_extension=...xdebug... instead of extension=...xdebug... Commented Aug 8, 2017 at 8:42
  • @KannaKim find extension=xdebug.so in your php.ini or find it in files like php.d\20-xdebug.ini and comment it out. Then add zend_extension=xdebug.so instead. This should solve Xdebug MUST be loaded as a Zend extension in Unknown on line 0 issue. For php load dynamic library visit this. Hope it helps Commented Aug 9, 2017 at 5:46

2 Answers 2

2

You need to match port three different places:

  1. php.ini file
  2. Netbeans > Options > php > Debugging > Debugger Port
  3. Netbeans > Project Properties > Run Configuration > Advance Web Configuration > Debugger Proxy Port (Assuming you are running Local Web Site (running on local web server)).

Then make sure to set xdebug.remote_host or xdebug.remote_connect_back=1 . Setting both of them does not work.

Following setting is recommended for php.ini

[xdebug]
zend_extension=xdebug.so
xdebug.remote_enable=on
xdebug.default_enable=on
xdebug.idekey="netbeans-xdebug"
xdebug.remote_handler=dbgp
xdebug.remote_autostart=off
xdebug.remote_port=9001
xdebug.remote_host=localhost
xdebug.profiler_enable_trigger=1
xdebug.profiler_output_name=xdebug-profile-cachegrind.out-%H-%R
xdebug.var_display_max_children = 128
xdebug.var_display_max_data = 2048
xdebug.var_display_max_depth = 128
xdebug.max_nesting_level=200

For more information visit How To Configure XDebug

Sign up to request clarification or add additional context in comments.

4 Comments

I can't find any Advance Web Configuration in Netbeans > Project Properties > run config this is how my run conf looks like . I'm using Netbean IDE 8.2
You need to change the Port to 9000 if you are running Built-in Web Server. It is not usually the case though. My answer is for when using local web server (most common case).
oh thanks, and by the way 2 questions 1. "Then make sure to set xdebug.remote_host or xdebug.remote_connect_back=1 . Setting both of them does not work." << my xdebug.remote_host has value of = 127.0.0.1 not a 0 or 1 isn't the remote_host supposed to be IP address or localhost? 2. should I match my port to 9001? since your recommended php.ini has remote_port = 9001
The xdebug.remote_host can be IP address or host name known to your server. The xdebug.remote_port should be any open network port. Usually 9000 or 9001 for xdebug. But remember to match it everywhere.
0

I'm running Netbeans with php and XDebug (on Windows/Apache). It's working fine. (I checked it also with the Netbeans Built-In Web Server)

The relevant part of my php.ini:

zend_extension=C:\Bitnami\wampstack-5.4.35-0\php\ext\php_xdebug-2.2.6-5.4-vc9.dll
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000

In the default Setup (with the Built-in Server) the browser talks over Port 8000 to the PHP Built-In Server and the PHP Build-In Server talks over Port 9000 to the Netbeans debugger Part.

So on some Windows Systems you have to open/allow these two ports in the firewall settings for the php executable.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.