Is it possible to configure the Zend PDT debugger in eclipse to hit a breakpoint from a browser action in a similar way to that of the Java debugger for eclipse? I.e. Set a breakpoint, start the debugger, browse a site then drop into a breakpoint when it is hit.
I can debug individual scripts and Web pages however I am trying to debug a script that is called from a webpage. I am using Joomla and want to be able to traverse the dependency stack while click on page content.
Thanks in advance for any advice..!
I found out how to do this but it is quite long winded. It enables you to debug PHP like you debug Java as in you can browser your site and only drop into the debugger when you hit one of your break points. Here’s the config for Linux.
Installing Zend Debugger
First you will need to install and configure the Zend Debugger:
Add this repository to your sources list in Help > Install New Software…: http://download.eclipse.org/releases/helios
Configure php.ini to point to the ZendDebugger.so file.
into a terminal to find the correct php.ini file you need to edit and open it in a text editor
into a terminal and copy the location to the php5 Debugger file.
Restart PHP by typing
into a terminal.
Then type the
command into your terminal to ensure the Zend Debugger is properly configured. You will see something like:
near the end of the dump. If you don’t see the Zend Debugger then make sure you have edited the correct php.ini file and ensure that the path to your ZendDebugger.so file is valid. Make sure to restart PHP for any changes to propagate.
Configuring Eclipse
Next you will have to configure Eclipse:
Select the project you want to debug and click OK.
this should be the same URL as in your host config that you use in dev’ to get to your home page. Give the config a name and set it as default. Click Finish and OK then restart Eclipse.
After installing the Opera browser go to the Window > Preferences > General > Web Browser settings again and select New and use these parameters:
click OK, select Firefox if it exists and remove it then check Opera and click OK.
Restart Eclipse again and you will be ready to start debugging PHP.
Using the Debugger
You may see an alert window asking you to confirm the debug URL. Remove eveything after the base URL to leave just:
as the URL and click OK.
If eclipse doesn’t switch to the PHP Debug Perspective automatically then switch to it manually.
Troubleshooting