Debug php Eclipse - php

I'm having a very hard time getting a breakpoint to hit in some php code. I don't do much php so might be newbie error.
I've read though the other questions, PDT Install Instructions, and XDebug Install Instructions
For both debuggers, the instructions expect a config section to show up in the phpinfo() and it doesn't for me.
Some info about my current setup
Windows
AMPPS
PHP 5.2.17
Website runs fine
I need some help with things to check or ideas what I might need to do differently.
I'm stuck pretty much for now.

You can follow this post to install Xdebug for PHP in AMPPS.

Two main things that fixed my issues.
Turned off Iron PHP Loader
copied the non-ts XDebug .dll, even though the php config shows thread safe = enabled. This dll seems to work
The config settings are below for reference:
;Stuff to allow debugging in eclipse
zend_extension="C:\Program Files (x86)\Ampps\php\ext\php_xdebug-2.2.3-5.3-vc9.dll"
xdebug.remote_enable=On
xdebug.remote_autostart=On
xdebug.remote_handler=dbgp
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
xdebug.remote_mode=req
You do have to make sure and add the extra xdebug configurations or eclipse won't cooperate.

Related

The debugger is not attached - Xdebug - Atom (php)

I'm attempting to install xdebug on to my atom in order to debug my magento 2 code on a wamp server. I think i have installed xdebug successfully according to my phpinfo() file however when I come to attach a debugger in atom, xdebug doesn't appear.
My php.ini settings are:
; XDEBUG Extension
[xdebug]
zend_extension ="c:/wamp64/bin/php/php7.1.16/zend_ext/php_xdebug-2.6.0-7.1-
vc14-x86_64.dll"
xdebug.remote_host=127.0.0.1
xdebug.remote_enable = 1
xdebug.remote_connect_back=1
xdebug.remote_port = 9000
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_autostart=true
;xdebug.profiler_enable = off
;xdebug.profiler_enable_trigger = Off
;xdebug.profiler_output_name = cachegrind.out.%t.%p
;xdebug.profiler_output_dir ="c:/wamp64/tmp"
;xdebug.show_local_vars=0
I haven't managed to find a complete tutorial online that works. I was following the Atom Tutorial, however I could not get it to work. I think the error may be with the IDE key as i'm not sure what to do with it. I've followed almost every youtube video but it still seems i'm doing something wrong.
If someone could post a working tutorial I would very much appreciate it. Thanks in advance :)
Screenshot of the problem
PHP Version 7.1.16
Xdebug Version 2.6.1
I've seen in the comment section of the question, that you have moved to Visual Studio Code, But I'll write down this answer anyway as someone else may find it helpful.
I've also came across this issue: "Debugger not attached".
When you install php-debug it require one more package: atom-debug-ui - which is not the issue.
Once php-debug is installed it also recommends to install couple more packages: ide-php and atom-ide-ui. The latter package can be problematic as it also contains it's own debugger UI.
Therefore when you install all four packages, there are two set of debugger UIs running on your Atom IDE.
To overcome this, what you should do is disabling atom-ide-ui's debugger. You can also go ahead and uninstall atom-ide-ui as it's not required for php-debug to run. If ide-php package depends on atom-ide-ui, you can uninstall ide-php as well.
I understand the question is about a setup which runs on WAMP. I've written this article on how to set it up on Ubuntu based Linux. In that article I've provided all the details you want. I don't think it would be too hard to translate the information to Windows based setup.

PHP Xdebug Laravel application in IntelliJ IDEA

Could you please advice me how properly configure Xdebug for Laravel application. I found a lot instructions for PhpStorm but they do not work for me as I'm using IntelliJ IDEA Ultimate.
What I have already achieved - I can debug single PHP script but not whole application. I cannot follow completely the instruction which is given for PhpStorm because on step when I need to configure Run/Debug Configuration I got stucked.
Much appreciation on any help in advance!
Okay, I gathered full instruction how to work with XDebug and IntelliJ Idea Ultimate to debug Laravel application and Windows specifically (if you use other OS the installation part will be different but other should be the same):
First of all you need to install XDebug itself and configure PHP to work with it. For that:
Find out which PHP version you use using phpinfo() you will need Version, Architecture and PHP Extension Build sections to complete next step.
Go to https://xdebug.org/download.php and download appropriate build. Basically it is dll provided for specific PHP you have installed
After that copy that DLL to Apache modules directory - for me that is D:\OSPanel\modules\http\Apache-PHP-7-x64\modules\ as I'm using OpenServer.
Put into php.ini file following configuration:
[Xdebug]
zend_extension="D:\OSPanel\modules\http\Apache-PHP-7-x64\modules\php_xdebug-2.6.0-7.1-vc14-x86_64.dll"
xdebug.remote_enable = 1
xdebug.remote_host = "localhost"
xdebug.remote_autostart=on
xdebug.remote_enable=on
xdebug.remote_port=9000
xdebug.idekey="PHPSTORM"
where php_xdebug-2.6.0-7.1-vc14-x86_64.dll is name of dll I personally downloaded.
Restart Apache
Open your Laravel project and check your Debuggin configuration (File > Settings... > Languages & Frameworks > PHP > Debug): check XDebug section if Debug port is the same as you specified above (it should be, if you did not changet it previously)
Delete all your Run/Debug configurations
Install Xdebug Helper for Chrome or any other extension if your not using Chrome (Browser Debugging Extensions)
Hit Run > Start listening for PHP Debug Connections
Put break point in your project and open appropriate site context
Enjoy!
Hope that will be useful for community.

php zend framework 1 netbeans xdebug

I work in a Mac (OSX 10.10.3 Yosemite), with Bitnami XAMPP 5.6.3, Netbeans 7.3.1, and the xdebug configuration showed down. With my "normal" PHP projects everything works fine, but now I am trying to learn Zend Framework, and I have installed ZendFramework-1.12.17, for which I reached to obtain a "Hello world" in a PHP 5.3 project, but when I try to debug the same project, the status bar of the debbuger remains "Waiting for connection netbeans-xdebug" forever.
I searched the web, but I think that this is so specific case that I could only find an answer on this forum recomending to install XAMPP 1.7.0 :( very old version) that has Zend Extension Manager, something that 1) doubt it can work with my configuration and 2) can affect my other projects.
Can someone help me please? Thank you and best regards.
In php.ini:
zend_extension = /Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20131226/xdebug.so
/xdebug.so
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000

Eclipse PHP won't stop at break points

I'm running Eclipse on Ubuntu 13.1 (I know, the worst Linux ever).
The fact is that I'm not used to Eclipse moved from Komodo 2 weeks ago, and the main reason why I'd migrated to Eclipse is debugging. But I can't put that to work. I already follow some tutorials with no joy.
My Xdebug is installed and working (checked with phpinfo()). I'm configuring Eclipse to work with Xdebug, but when I start the debugging it ignores the break points, even if I check to "Break at First Line" it won't break.
Here's a summary of the scenario that I have:
System: Ubuntu 13.1 64bits
PHP: 5.5.3-1ubuntu2.1
Xdebug: 2.2.3
Eclipse Platform: 3.6.2
PDT: 2.2.1
Tnx!
Problem solved! Actually the xdebug was installed but I missed one configuration. The xdebug.ini file was with only the following line:
zend_extension=/usr/lib/php5/20121212/xdebug.so
I'd added the following lines:
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
and it's working! Just reconfigured the eclipse debug and is working.

Debugging php on ubuntu 9.04?

Is there any IDE (linux based) for PHP that can be used to debug? Or any one can help me to configure debug properties/settings of eclipse? Now i am using ubuntu 9.04. i have tried to debug but havn't tried to configure, because i don't know how to configure it. can you tell me the exact way? please help me.
I use ActiveState Komodo IDE 5 w/ xdebug & xdebug helper firefox extension.
** You can use most of the info below for any IDE that supports xdebug **
You need to add the xdebug information to your php.ini.
[xdebug]
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.extended_info=1
xdebug.idekey=
Then, in preferences->languages->php, go thru the debugger wizard. Next you must turn on "listen for debugging connections" in Komodo IDE under the Debug dropdown.
Setup the xdebug helper firefox addon and enter the required info in its config dialog for your debug server, restart firefox and click the icon in the lower right corner to begin using xdebug on a page.
I recommend Eclipse PDT with Xdebug.
You can also try Aptana (based in Eclipse) or NetBeans.
Working with NetBeans and PHP is really simple. ou can follow this tutorial
I am using PHPStorm with xdebug. Works quite well :)

Categories