Solved

Debugging PHP with Netbeans

Posted on 2014-03-14
5
6,242 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
Comment Utility
Exlipse has it if it helps.
0
 
LVL 36

Assisted Solution

by:Loganathan Natarajan
Loganathan Natarajan earned 167 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
These days socially coordinated efforts have turned into a critical requirement for enterprises.
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
The viewer will learn how to count occurrences of each item in an array.

744 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

15 Experts available now in Live!

Get 1:1 Help Now