Installing Zend Debugger on Wamp/Windows 7 - php

I got the latest XAMPP package and extracted it at c:\tools php.exe -v gives following output
C:\tools\xampp\php>php.exe -v
PHP 5.3.5 (cli) (built: Jan 6 2011 17:54:09)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
Eclipse PDT, I am using, has this version
Eclipse for PHP Developers
Version: Helios Service Release 2
Build id: 20110218-0911
Then I added ZendDebugger to eclipse from http://downloads.zend.com/pdt, so it created folder C:\tools\eclipse-php-helios-SR2-win32\plugins\org.zend.php.debug.debugger.win32.x86_5.3.18.v20100905\resources\php53
I modified php.ini { found in c:\tools\xampp\php } to setup ZendDebugger.dll
But no matter what I do, I am not able to debug my php web applications.
I get this error when I do "Test Debugger" from Eclipse
A timeout occured when the debug server attempted to connect to the following client hosts/IPs: -127.0.0.1
Then I came across this old post Installing Zend Debugger on Wamp/Windows Vista. Do I need to go back to old versions of php in order for zend debugger to work with Eclipse?
regards, Yogesh

xdebug is working in my case - so this should not be a problem related to php5.3 and xdebug.
For this I'd check the following things:
Is xdebug installed and enabled? (call phpinfo() to get more informations) If you can't find any informations xdebug is not installed.
Does xdebug stop the script if you call the php-function xdebug_break(); ?
xdebug needs a cookie to be activated. Is this cookie set by eclipse? Just try var_dump($_COOKIE)
Do you have this behaviour also if you try another environment? For example netbeans or phpstorm?
If the function xdebug_break() works but the script does not stop at breakpoints set in the IDE - I'd check if the dll-file for xdebug is included as zend_extension or extension. Xdebug has to be included as zend_extension for it has to be started before the parser of php is started!
Here's a good link to explain every step in it's detais. It's related to the IDE Komodo - but the installation of xdebug is the same:
http://docs.activestate.com/komodo/5.0/debugphp.html
Bye
Simon

Related

Debug session was finished without being paused

In my Laravel project using PhpStorm (2018.1) I am not able to debug my session using xdebug (2.9.5). Any breakpoint gets ignored and session ends without being paused. If I set Break at first line in PHP scripts then session stops at index.php file. I am using Ubuntu 20.04.
PHP 7.4.5 (cli) (built: Apr 23 2020 08:10:29) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Xdebug v2.9.5, Copyright (c) 2002-2020, by Derick Rethans
This are my settings for xdebug in php.ini
[xdebug]
zend_extension = /opt/lampp/lib/php/extensions/no-debug-non-zts-20190902/xdebug.so
xdebug.remote_enable=1
xdebug.remote_port=9001
xdebug.remote_log="/tmp/xdebug.log"
I have some PhpStorm settings:
What am I missing here?
I also have Xdebug helper extension in my Chromium but it seems to have the same effect with it enabled as well as disabled.
In my Laravel project using PhpStorm (2018.1) I am not able to debug my session using xdebug (2.9.5).
It just triggered:
PhpStorm 2018.1
Xdebug 2.9.5
You have to upgrade PhpStorm. You need PhpStorm 2018.3 or newer in order to be able to work with Xdebug 2.7 or newer.
The problem is in changed XML namespace in Xdebug protocol, as of Xdebug 2.7 (https instead of http). It's fixed/supported since PhpStorm 2018.3 (see WI-43622).
With your current IDE version you may work with Xdebug 2.6.x max (which does not support PHP 7.4).

Installing xdebug on Ubuntu LAMP stack

I keep throwing this error but I have version 7.1.2 installed. Why can't I ./configure
Here is my error message:
checking whether to enable Xdebug support... yes, shared
checking Check for supported PHP versions... configure: error: not supported.
Need a PHP version >= 7.0.0 and < 7.3.0 (found 5.3.10-1ubuntu3.26)
root#precise32:/var/www/xdebug# php -v
PHP 7.1.2-3+deb.sury.org~precise+1 (cli) (built: Feb 22 2017 10:29:40) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies
with Zend OPcache v7.1.2-3+deb.sury.org~precise+1, Copyright (c) 1999-2017, by Zend Technologies
root#precise32:/var/www/xdebug#
Has anyone else encountered this problem. I've tried reinstalling php 7.0 and several other tactics. Read through a bunch of different stack questions similar but I can't figure it out.
Which means I can't move on to: make
make install
cp modules/xdebug.so /etc/php.d/xdebug.so
You're using the PPA from Ondřej Surý. So you can easily install xdebug by using apt-get install php7.1-xdebug.
Edit: How-To configure Xdebug (on Ubuntu based Linux systems):
Create an ini file /etc/php/7.1/mods-available/custom.ini and put the following configuration into it:
; priority=90
[xdebug]
xdebug.remote_enable=1
; replace <Host-IP-Address> with the IP of your host system!
xdebug.remote_host=<Host-IP-Address>
; You'll need this later.
xdebug.idekey=PHPSTORM
xdebug.profiler_enable_trigger=1
Now activate the configuration with the command sudo phpenmod -v 7.1 -s ALL custom. Don't forget to restart your web server.
Second you need an IDE which supports the dbgp protocol. I use PhpStorm, it's fast (even it runs for hours) and of cause, it has a native Xdebug support.
After you've set up your IDE and set at least one breakpoint in your code, you can trigger the debugger very simple:
1st option: Add the query parameter XDEBUG_SESSION_START=PHPSTORM (where PHPSTORM is the value of the xdebug.idekey setting in your configuration file).
2nd option: Send a cookie with the content XDEBUG_SESSION=PHPSTORM with your request. cURL example: curl -H 'Cookie: XDEBUBG_SESSION=PHPSTORM' http://my-awesome.domain/awesome-script.php.
If you've set up anything correctly, you can now play with Xdebug.
Xdebug - Documentation
PhpStorm - Configuring Xdebug
PhpStorm - Zero-configuration Web Application Debugging with Xdebug and PhpStorm
And last but not least, some nice-to-have Xdebug settings:
; enable colors for the command-line interface
xdebug.cli_color=1
; show more data when using var_dump
xdebug.max_nesting_level=500
xdebug.var_display_max_children=512
xdebug.var_display_max_data=2560
xdebug.var_display_max_depth=200
; enable trigger for easy profiling
xdebug.profiler_enable_trigger=1
Have nice debugging sessions :)

error upgrading php in mac

I am running OSX El Capitan (version 10.11.6).
I had php 5.5 installed.
Phpunit requires php5.6 and more so I tried to upgrade my php to 5.6. I couldn't do it so I gave php7 a try.
I followed these guides:
https://coolestguidesontheplanet.com/upgrade-php-on-osx/
https://php-osx.liip.ch/
Mac upgraded PHP to 5.6, but CLI php -v get 5.3.28?
My current output with php -v is :
PHP 7.0.12 (cli) (built: Nov 1 2016 10:21:11) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
with Zend OPcache v7.0.12, Copyright (c) 1999-2016, by Zend Technologies
with Xdebug v2.4.1, Copyright (c) 2002-2016, by Derick Rethans
Funny thing, my output with a phpinfo(); when called from somewhere inside a Symfony project, is still PHP Version 5.5.36
Any ideas??
Terminal uses a different PHP than a HTTP server in browser. You can check what PHP you're using in CLI (command line interface) by this terminal command:
$ which php
I don't know if you use any AMP stack (like MAMP). They include their own PHP, so you need to update them in order to have a different PHP version in browser.
Maybe you can use this trick to determine what PHP versions you use in browser / CLI: Find the php.ini path in your phpinfo() output and compare it with this terminal command:
$ php -i | grep php.ini
It's always a good idea to use the debug URL to troubleshoot your Symfony projects; to use this, simply append:
app_dev.php
For example if your route was like http://myhome/, then you would use:
http://myhome/app_dev.php
Then on the bottom of your browser you will have the Symfony debug bar. In the bottom right corner, the version of Symofny is shown, an if you move your mouse over it, you will see the version of PHP; plus also a link to "View phpinfo()". You can click on it to view the full PHP information, including where the PHP file is located.
The PHP config file used (shown on the phpinfo() page) is shown by:
Loaded Configuration File
Hope that helps!

Zend Debugger - Wamp2.2 + Eclipse PHP

I am trying to get zend debugger woking with eclipse so that I can trigger breakpoints in my code.
I have installed wamp 2.2 (uses PHP 5.3.10 - thread safe)
I have installed the eclipse 'all in one' package from zend.
I have updated my php.ini to include
zend_extension = "c:/wamp/bin/php/php5.3.10/zend_ext/ZendDebugger.dll"
[Zend]
zend_debugger.allow_hosts="127.0.0.1"
zend_debugger.expose_remotely=always
When I launch my php.exe it shows
Cannot load Zend Debugger - it was build with configuration API220090626,NTS,VC9, whereas running engine is API2200090626,TS,VC9
I have read that ZendDebugger only works as non thread safe so I cannot just download a ts version. I cannot find a download link for php 5.3.10 (http://windows.php.net/download/)
However, when I try to replace my copy of php with 5.3.13 (nts) my sqlsrv extension is not compatible and I get the error
PHP Startup: Unable to load dynamic library 'c:wamp/bin/php/php5.3.10/ext/php_sqlsrv_53_nts.dll' - %1 is not a valid Win32 application
If I change my php.ini to not load the sqlsrv extension I still get the error
Failed loading c:/wamp/bin/php/php5.3.10/zend_ext/ZendDebugger.dll
Does anyone know how I can get debugging to work with Zend Framework, Eclipse, wamp and sqlserv?
Cannot load Zend Debugger - it was build with configuration API220090626,NTS,VC9, whereas running engine is API2200090626,TS,VC9
NTS means Not-Thread-Safe, and hence you must use a NTS build of PHP... Which is how you run PHP as a FCGI process (vs. Apache Thread via mod_php).
Zend does not usually provide or support TS builds of anything anylonger (since after PHP 5.2), and it looks like your setup is meant for a TS build...
You could try two things:
Use a WAMP that ships with PHP as FCGI (NTS) option (I know the latest version of Wamp-Developer does, but it's commercial, maybe see if XAMPP or another Wamp does?)
Or instead of ZendDebugger, try using XDebug. It comes both as TS and NTS builds. And I'm sure you can use Eclipse with it.

PHPEclipse & XDebug script debugging

I am trying to get XDebug debugging working in PHPEclipse.
All the resources I have found on the net are centered around using a web server with remote debugging. I am trying to achieve script level debugging so no web server is involved.
I have a debug configuration setup using the "PHP XDebug Script" type, and when I run the debug option in Eclipse, PHP is executing the script and output is sent to the console generated by the script.
What is wrong however, is the debugger is not stopping on any breakpoints that I add to the file in Eclipse. They are being skipped. How do I make the breakpoints work?
PHP & XDebug versions installed:
PHP 5.3.10 (cli) (built: Feb 2 2012 22:12:16)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies
with Xdebug v2.1.4, Copyright (c) 2002-2012, by Derick Rethans
I have not added any additional configuration options for XDebug within PHP. Whilst I have tried adding remote debugging options to see if that solves the problem, I assume all remote debugging options at this point are not relevant for doing localised script debugging so removed them again (and it didn't fix the problem anyway).
I am using Eclipse version 3.7.1 R3_7_1. on Fedora 16, 64bit.

Categories