Debugging php code using breakpoints on eclipse - php

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

Related

Using netbeans IDE for debugging PHP application

We are using xampp with PHP in our local machine. We would like to use the netbeans IDE for debugging our application. We followed the steps as referred in https://netbeans.org/kb/docs/php/debugging.html#debuggingSession. We installed netbeans version 8.2
Currently we are able to configure the project and are able to set the break points.
But while executing, the application is not getting stopped at the break points
We also tried the setting ‘xdebug.extended_info = 1’ as referred in Netbeans 8.0.2 Debugger Breakpoints Not Working. But still this is not working
Could you please suggest what we missed.
Thanks

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.

XDebug on Eclipse PHP problems

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

How Setup PHP development environment to use Eclipse IDE, IIS,Team Foundation Server(TFS)

I am new to PHP scripting language. Basically I am a .Net guy, worked on various web applications using MVC, Razor, ASP.NET, C#...etc. I thought this the best time to practice on PHP and planning to start work on projects using PHP.
I am trying to setup PHP development environment in my local machine.
Please guide me in the following questions.
What are the available software’s I need to install in my machine to start PHP development (SQL, IIS, PHP scrip, TFS)?
In order to create team project I want to use Team Foundation Server (TFS) within the eclipse IDE. Pease tell me someone, how to connect TFS from eclipse IDE (or) any alternate ways?
How to configure IIS to server PHP web pages? Do I need to install additional software other than eclipse?
I have done the following steps,
I downloaded Java from java.com.
I downloaded eclipse from eclipse.org then installed to my machine and pointed to default workspace(C:/users/xxxx/workspace).
Installed add-on phpeclipse to eclipse IDE. This add-on downloaded from phpeclipse.com
Open Eclipse IDE=> help=> Install New Software=> Add.
Name: [PHPEclipse]
Location: [http://phpeclipse.sourceforge.net/update/stable/1.2.x/]
Ok=> followed instruction to complete installation.
After completing the above steps, I just created a new PHP project then wrote echo statement in .php page but it prompting me below error when I run my test project

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