Solved

Debugging PHP with Netbeans

Posted on 2014-03-14
5
6,325 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 62

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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

Lync server 2013 or Skype for business Backup Service Error ID 4049 – After File Share Migration
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

623 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