XDebug on Eclipse PHP problems - php

I´m starting working with PHP on Eclipse and I´m having a bad time with XDebugger. This is my first time setting up this enrironment...
I´m running Eclipse 3.8.1 with PHP Development Tools SDK (I have also C++ installed on this Eclipse).
I´ve followed the instruction from the official xdebug site to install XDebug. It seens to be installed fine, as we can see from a phpinfo() call:
Well, once installed, I go to Eclipse, insert my breakpoints on the code, configure the debug configuration and when I call Debug As->PHP Web Application all I get is an empty window on Firefox with the following link:
http://localhost/myproject/index.php?XDEBUG_SESSION_START=ECLIPSE_DBGP&KEY=14380396300041
Absolutely nothing happens neither to Eclipse or on Firefox.
Here is my configuation for debugging:
PS: I haven´t installed anything related to ZEND. Is it necessary ? Here is a error I get when using the Zend Debugger option:
Help appreciated!!! Hope this will be basic learning for solving...

To debug on zend debugger, you need zend debugger installed.
For xdebug remote debugging (browser run) you have to enable dbgp protocol:
https://wiki.eclipse.org/Debugging_using_XDebug#Configuration

Related

How to launch and debug php using VS Code?

I'm new to VS Code and the php world. My experience is more with heavyweight IDE such as Visual Studio. However, I have a need to setup a php environment on my dev machine and am having some trouble getting it to work properly.
My environment is a Win 10 dev machine. I am using VS Code and php ver 5.5. I have properly installed the xdebug extension and verified it is properly installed. I have also installed the php-debug extension in VS Code.
The challenge I'm having and have been unable to find any useful information through google is launching the php website from within VS Code and then being able to debug it.
A few things I have tried, but haven't worked.
I installed the iis-express extension to VS Code which allows for running any folder through iis express. https://marketplace.visualstudio.com/items?itemName=warren-buckley.iis-express
This works, but the website doesn't display properly. IIS returns an error message saying the site is not properly configured. It's apparently missing a mapping or something along those lines.
I followed this blog. http://blog.denouter.net/2015/05/run-php-from-visual-studio-code.html and am able to run the website using the built in php web server.
Installed webmatrix and let the windows platform installer correctly install and wire up iis express to work with php. The same folder works fine when running from webmatrix.
Installed the php-debug extension to VS Code. https://github.com/felixfbecker/vscode-php-debug
Here is what I think I'm missing. I believe I need to launch the website from within VS Code for the debugging to work. I can't figure out how to "launch" the php website from within VS Code. The php-debug extension from VS Code only supports launch. It doesn't support "attach" mode. I suspect this is why when I run the website outside VS Code, the debugger doesn't work. Let me be clear, the debugger is working when I hit F5, it just doesn't ever stop on any breakpoints.
To summarize: How can I launch and debug my php website from within VS Code? I'm looking for a detailed step by step guide.
Thank you
I am the author of vscode-php-debug. You do not need to "launch the website" from inside VS Code. When you start the "Listen for XDebug" configuration from the debug section, VS Code (or rather, my debug adapter) will listen on port 9000 for XDebug. You need to run a web server like Apache, IIS or nginx locally on your PC and configure it to serve PHP files - this has nothing to do with VS Code. Then simply open a web browser and navigate to localhost and XDebug will connect to the debugger, stopping on breakpoints.
The two necessary settings in php.ini are:
xdebug.mode = debug
xdebug.start_with_request = yes
(Do not forget to add the subtitle [XDebug] before the settings.

Debugging php code using breakpoints on eclipse

I am new to php and running php on my system .
As IDE I am using
Eclipse for PHP Developers
Version: Helios
As server I am using : WAMPSERVER
Basically on eclipse I link my php project to one I have placed in www folder of wamp installation. I do all development in eclipse and then run the project on wampserver.
What I am not able to do is debug the code at all. I want to use breakpoints debugging as I could in Java programming using eclipse.
Please help, I have seen so many threads about xdebug and zend debug, but these have been of no help to me,
Any help is appreciated, let me know if I am doing everything wrong as in using both eclispse and wamp separately.
Thanks

PHP debugging in Eclipse

I am trying to configure Indigo so I can debug PHP in eclipse. I have looked at a ton of different tutorials and blogs online that try to explain it but none work so far. I am using Ubuntu 11.04 and I use a generic LAMP stack with PHP 5.3.3 executables configured in eclipse.
Does anyone have a good guide for installing Zend or XDebug in Eclipse Indigo?
Ok so this is something I posted a while back which took a while to figure out. I got it working in Helios but it has worked for me in Indigo also: Can I link the Zend PDT (eclipse) to a browser action?

xDebug stability problems

I'm running eclipse PDT on a xubuntu 10.9 VM, using xdebug to remote debug PHP 5.3.
I have been having a number of issues over the last 6 months, things like:
Debugger stops responding to breakpoints after being dormant for 20+ minutes.
Debugger will exit suddenly with the fatal error "unexpected termination". Requires eclipse to be restarted to debug again.
Non fatal errors will pop up, I possibly think this is due to modifying code during execution.
Is this an issue that can be fixed by upgrading or switching to Zen? Its really frustrating compared to using PyDev or Java debuggers.
Is anyone else experiencing this same sort of issue?
With Eclipse, xdebug is sometimes a little unstable. Here, I use Zend Studio with Zend Debugger and xdebug. Everything works fine.
About breakpoints stops, I got a issue too. The only way to control this was use the Zend Toolbar to call debugger from Firefox/IE.
I know people that works fine with Netbeans + xdebug, too.
Try to download and install Zend Debugger and configure your Eclipse to work with it. Eclipse Helios has many improvements around it - try it if you use a older Eclipse version.

Debugging PHP on NetBeans 6.8 without Apache

Is it possible to debug PHP projects on Glashfish with NetBeans 6.8 without installing Apache server?
After I press CTRL+F5 im getting 404 not found error.
As ASP.NET developer I have (I think) similiar developer server bundled with Visual Studio, so there is no need to install any other server like IIS. Am I right that Glassfish is similiar developer server, so why Im getting 404?
Thanks
Darek
From Netbeans page.
To successfully debug PHP applications in the NetBeans IDE for PHP, you need to have the PHP engine, the Apache local web server, and the XDebug debugger installed and configured for PHP development. If you have difficulties getting XDebug to work, see the NetBeans wiki on XDebug and/or ask the community at users#php.netbeans.org.
I hope it helps

Categories