Debug session was finished without being paused - php

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).

Related

Xdebug not working on Mac (using PhpStorm)

I've recently had to swap over to a MacOS for development. Previously I had Xdebug running fine and it's such a massive help that I want to use is again.
I followed the Mac/homebrew instructions here: https://xdebug.org/docs/install#pecl with some more information that I found here: https://xdebug.org/docs/install#configure-php
php -v:
Cannot load Xdebug - it was already loaded
PHP 7.4.27 (cli) (built: Dec 16 2021 18:02:37) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Xdebug v3.1.2, Copyright (c) 2002-2021, by Derick Rethans
with Zend OPcache v7.4.27, Copyright (c), by Zend Technologies
In my php.ini (I double checked that it was the correct one) I appended
zend_extension=xdebug
I am running my site on a docker setup, and am using PhpStorm, here are the settings:
I have the Xdebug extension installed in Chrome and have made sure that PhpStorm is listening. However, when I put a breakpoint in my home controller and navigate to that page, the page loads without any breakpoints being hit.
phpinfo() also shows that xdebug is loaded:
I've noticed that the xdebug version shown in the phpinfo dump does not match the version of xdebug I downloaded and installed:

PhpStorm and Xdebug not working in Laravel project

I am using php 8.1, PhpStorm version 2021.2.3. Xdebug 3
When I create a single PHP file and run it in the built-in web server I can debug correctly opening it from the browser with the Debug extension enabled. However, when I try to do the same from the Laravel project nothing happens.
This is my Xdebug config:
[xdebug]
zend_extension="xdebug.so"
xdebug.mode=debug
xdebug.start_with_request=trigger
xdebug.client_port=9003
xdebug.discover_client_host=1
php -v
PHP 8.1.0 (cli) (built: Nov 28 2021 01:33:49) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.0, Copyright (c) Zend Technologies
with Zend OPcache v8.1.0, Copyright (c), by Zend Technologies
with Xdebug v3.1.2, Copyright (c) 2002-2021, by Derick Rethans
If I try for example creating a breakpoint in my controller and running my project on the browser with the Xdebug extension enabled nothing happens.
Also, if I create a breakpoint in a model and try to do php artisan tinker and trigger it nothing happens either.
I am wondering what could I be missing.

Xdebug with VS Code on ubuntu not working

I am trying to debug php using xdebug on ubuntu 16.04 with Visual Studio code. I installed xdebug as per the instructions from the following site-Xdebug wizard. In the xampp the php version is shown as PHP Version 5.5.6 but when i run the command php -v in terminal, it shows
PHP 7.0.15-0ubuntu0.16.04.4 (cli) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
with Zend OPcache v7.0.15-0ubuntu0.16.04.4, Copyright (c) 1999-2017,
by Zend Technologies
I don't know if that may cause any problem. But, the real issue is that Debugger doesn't stop at any breakpoints. Also, it sometimes shows unverified breakpoint message. Sometimes it just runs and never stop at any breakpoints. The Xdebug options don't fully show up in phpinfo() page even after the installation. I don't understand the problem.
make sure you have configure xdebug.ini file. here mine.
[xdebug]
zend_extension=xdebug.so
xdebug.remote_autostart=1
xdebug.remote_log=/var/log/apache2/xdebug.log
xdebug.default_enable = 1
xdebug.remote_enable=1
xdebug.remote_port=9000
sudo apt-get install php-xdebug

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.

Installing Zend Debugger on Wamp/Windows 7

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

Categories