Solved

Debugging PHP with Netbeans

Posted on 2014-03-14
5
6,256 Views
Last Modified: 2014-03-21
Hello Experts,

I have PHP installed on a Windows 7/IIS 7.5. I also have Netbeans installed on the same machine and I am wondering how can I use it's debugging tools like Breakpoints, Variable Tracing, etc.?

Thank you,
0
Comment
Question by:APD_Toronto
5 Comments
 
LVL 61

Accepted Solution

by:
gheist earned 167 total points
ID: 39931150
Exlipse has it if it helps.
0
 
LVL 36

Assisted Solution

by:Loganathan Natarajan
Loganathan Natarajan earned 167 total points
ID: 39931158
You need to configure with "XDebug 2.0 or later" to do with netbeans.
Did you see this link? https://netbeans.org/kb/docs/php/debugging.html
0
 

Author Comment

by:APD_Toronto
ID: 39932987
Ok, since I am running IIS, using your link above I installed xDebugger 2.2.4 manually and confirmed that it is installed within phpInfo()

Now when I try to debug, I get the following error


Error Summary
HTTP Error 500.0 - Internal Server Error
C:\php\php-cgi.exe - The FastCGI process exceeded configured activity timeout
Detailed Error Information
Module      FastCgiModule
Notification      ExecuteRequestHandler
Handler      PHP_via_FastCGI
Error Code      0x80070102
Requested URL      http://localhost:80/phpBook/ex_starts/ch06_ex2/index.php?XDEBUG_SESSION_START=netbeans-xdebug
Physical Path      C:\inetpub\wwwroot\phpBook\ex_starts\ch06_ex2\index.php
Logon Method      Anonymous
Logon User      Anonymous

However, if I run without debugger, I run without any errors.
0
 
LVL 13

Assisted Solution

by:AielloJ
AielloJ earned 166 total points
ID: 39943310
APD_Toronto:

You have to have the xdebug section at the end of your php.ini file.  The one below should work.

[xdebug]
xdebug.remote_enable = on
xdebug.remote_handler = dbgp
xdebug.remote_host = localhost
xdebug.remote_port = 9000
xdebug.profiler_enable = off
xdebug.profiler_enable_trigger = off
xdebug.profiler_output_name = cachegrind.out.%t.%p
xdebug.profiler_output_dir = "c:/wamp/tmp"

Regards,
AielloJ
0
 

Author Comment

by:APD_Toronto
ID: 39944095
I added the above to my php.ini, except the last line I set it to "C:\inetpub\wwwroot" since I am not using WAMP.

The issue is the same, as well, I forgot to mention... when I restart the machine (not just IIS) and go to debug within Netbeans, my application opens in my browser, I enter my data and click "Submit", then both Netbeans and my browser hang, this where I expect netbeans to show me my variable values. However, when I close my browser and cancel Debug within Netbeans, then re-run Netbeans debug again, it just hangs without opening my browser.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
These days socially coordinated efforts have turned into a critical requirement for enterprises.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now