When I try to debug something inside vagrant, I can step through the code, the debugger stops at breakpoint and all looks fine, until the request is done. Then I get the following error in the browser: 324 ERR_EMPTY_RESPONSE. Usual requests (without xdebug) are working without any problem. I can also debug simple php-scripts without encoded content (we use ionCube).
Here are some infos:
vagrant#localdev:~$ php -v
PHP 5.6.36-1+ubuntu14.04.1+deb.sury.org+1 (cli)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
with the ionCube PHP Loader (enabled) + Intrusion Protection from ioncube24.com (unconfigured) v6.0.6, Copyright (c) 2002-2016, by ionCube Ltd.
with Xdebug v2.5.5, Copyright (c) 2002-2017, by Derick Rethans
vagrant#localdev:~$ php --ini | grep -C20 'xdebug'
/etc/php/5.6/cli/conf.d/20-intl.ini,
/etc/php/5.6/cli/conf.d/20-ioncube.ini,
/etc/php/5.6/cli/conf.d/20-json.ini,
/etc/php/5.6/cli/conf.d/20-mbstring.ini,
/etc/php/5.6/cli/conf.d/20-mcrypt.ini,
/etc/php/5.6/cli/conf.d/20-mysql.ini,
/etc/php/5.6/cli/conf.d/20-mysqli.ini,
/etc/php/5.6/cli/conf.d/20-pdo_mysql.ini,
/etc/php/5.6/cli/conf.d/20-phar.ini,
/etc/php/5.6/cli/conf.d/20-posix.ini,
/etc/php/5.6/cli/conf.d/20-readline.ini,
/etc/php/5.6/cli/conf.d/20-shmop.ini,
/etc/php/5.6/cli/conf.d/20-simplexml.ini,
/etc/php/5.6/cli/conf.d/20-soap.ini,
/etc/php/5.6/cli/conf.d/20-sockets.ini,
/etc/php/5.6/cli/conf.d/20-sysvmsg.ini,
/etc/php/5.6/cli/conf.d/20-sysvsem.ini,
/etc/php/5.6/cli/conf.d/20-sysvshm.ini,
/etc/php/5.6/cli/conf.d/20-tokenizer.ini,
/etc/php/5.6/cli/conf.d/20-wddx.ini,
/etc/php/5.6/cli/conf.d/20-xdebug.ini,
/etc/php/5.6/cli/conf.d/20-xmlreader.ini,
/etc/php/5.6/cli/conf.d/20-xmlwriter.ini,
/etc/php/5.6/cli/conf.d/20-xsl.ini
vagrant#localdev:~$ cat /etc/php/5.6/cli/conf.d/20-xdebug.ini
zend_extension=xdebug.so
xdebug.remote_enable=On
xdebug.remote_host=192.168.123.1
; xdebug.remote_autostart=On
; xdebug.remote_connect_back=On
; xdebug.remote_handler="dbgp"
; xdebug.remote_port=9000
; xdebug.max_nesting_level=250
; xdebug.idekey="PHPStorm
I have the exact same issue as described here: https://intellij-support.jetbrains.com/hc/en-us/community/posts/206368089-Xdebug-only-partially-works
The last comment was:
After upgraded xdebug to 2.2.1 it's work fine for me :)
But I already use 2.5.5 and I think the problem is somehow related to IonCube.
I've read this, too, but as far as I see xdebug is loaded after ionCube anyway in my setup.
Related
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.
I've read and tried all the solutions concerning this question, I successfully installed Xdebug and when I type php --v on cmd I get:
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies with Xdebug v2.9.1, Copyright (c) 2002-2020, by Derick Rethans
I added the Xdebug configuration under php.ini:
[XDebug]
zend_extension = "C:\wamp64\bin\php\php7.2.10\ext\php_xdebug-2.9.1-7.2-vc15-x86_64.dll"
xdebug.remote_enable = 1
xdebug.remote_port="9000"
I edited the Debug/Run configuration like exactly mentioned in the tutorials and StackOverflow. My problem is that the the debugger is always waiting for incoming connection with ide key '(random number)'.
Am I missing something? Any advice could help, thanks.
I am working on a project and I want to use Xdebug. So far, so good.
But I don't get that darn thing working and it is stressing me out (and also my colleagues)
I am using Laravel Homestead/Vagrant with PhpStorm as IDE. The Homestead VM is a Ubuntu VM (18.04.1 LTS)
The steps I've taken to install Xdebug.
I've to install xdebug on my Vagrant VM, it is also loaded when you start PHP and compiled with it.
php --ini
...
/etc/php/7.2/cli/conf.d/20-sysvshm.ini,
/etc/php/7.2/cli/conf.d/20-tokenizer.ini,
/etc/php/7.2/cli/conf.d/20-wddx.ini,
> /etc/php/7.2/cli/conf.d/20-xdebug.ini, <
/etc/php/7.2/cli/conf.d/20-xmlreader.ini,
/etc/php/7.2/cli/conf.d/20-xmlwriter.ini,
/etc/php/7.2/cli/conf.d/20-xsl.ini,
/etc/php/7.2/cli/conf.d/20-zip.ini,
/etc/php/7.2/cli/conf.d/25-memcached.ini,
...
php -v
PHP 7.2.13-1+ubuntu18.04.1+deb.sury.org+1 (cli) (built: Dec 7 2018 08:07:36) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.2.13-1+ubuntu18.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies
with Xdebug v2.6.0, Copyright (c) 2002-2018, by Derick Rethans
with blackfire v1.24.0~linux-x64-non_zts72, https://blackfire.io, by Blackfire
I've been to File / Settings / Languages & Frameworks / PHP
This is the settings of my CLI Interpreter
This is the settings of Debug
And this is my config file
zend_extension=/usr/lib/php/20170718/xdebug.so
xdebug.idekey="PHPSTORM"
xdebug.remote_enable=1
xdebug.default_enable=1
xdebug.remote_connect_back=1
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
xdebug.max_nesting_level=300
xdebug.scream=0
xdebug.cli_color=1
xdebug.show_local_vars=1
How can I solve the problem that when I try to go to my website, the debugger does not work (PhpStorm is listening to incoming connections and I am using a Firefox plugin for Xdebug)
Facts about my systemUbuntu 15.10Php 5.6.11Symfony 2.7 PhpStorm 10xDebug 2.4
I really struggle getting xdebug to work under my Symfony project in PhpStorm.
I installed xdebug
configured the php.ini file in my /etc/php5/apache2/php.ini
and in the cli folder
[xdebug]
zend_extension=/usr/lib/php5/20131226/xdebug.so
xdebug.remote_enable = 1
xdebug.remote_port = 9000
xdebug.idekey = PHPSTORM
xdebug.remote_host=127.0.0.1
But when I "Start listening for PHP Debug Connections" and set breakpoints in my application and run tests with breakpoints in it, Xdebug just doesn't break the programm.
php -v
PHP 5.6.11-1ubuntu3.1 (cli)
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies
with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2015, by Zend
Technologies
with Xdebug v2.4.0, Copyright (c) 2002-2016, by Derick Rethans
Xdebug shows up under my PhP interpreter
If you need more Information please let me know
Thanks
Well I solved it by putting the xdebug settings in /etc/php5/apache2/conf.d/20-xdebug.ini
I am trying to load XDebug & ionCube loader simultaneously, when I type zend_extension_ts="path/to/ioncube_loader_win_5.2.dll" or zend_extension_ts="path/to/php_xdebug.dll" alone in php.ini they work. But I cant get them working simultaneously. Is there any way I can load them both ?
I was thinking if I can load them only for particular directory/project, I don't know if it is possible.
Xdebug is not compatible with ioncube: http://xdebug.org/docs/install#compat You can not have them both installed in the same server environment, so you'll have to set-up two server instances (or use lighttpd/nginx with two fast-cgi configurations) as I have described here: http://derickrethans.nl/multiple-php-versions.html
I have installed ionCube successfully on the top of Zend debugger without running into any issues,
To Install ionCube, I have downloaded the zip file for my OS from here
then I ran the localhost/ioncube/loader-wizard.php, it will tell you step by step what to do, for me because I have windows and wamp server I had to insert the ioncube folder in
C:\wamp\bin\apache\apache2.4.9\bin\
here is the php version and explanation:
PHP 5.5.12 (cli) (built: Apr 30 2014 11:20:58)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
with Xdebug v2.2.5, Copyright (c) 2002-2014, by Derick Rethans
I saw in other stackoverflow post mentioned by Arte Arefjev that the zend_extention of ioncube should be the first one to load so I did this:
zend_extension = "C:/wamp/bin/apache/apache2.4.9/bin/ioncube/ioncube_loader_win_5.5.dll"
zend_extension = "c:/wamp/bin/php/php5.5.12/zend_ext/php_xdebug-2.2.5-5.5-vc11-x86_64.dll"
all my debugger and at the same time my ioncube is working fabulous!
Hope it will help someone in the future.
For me it seems to work with php 5.3.10 as it says
with the ionCube PHP Loader v4.2.1, Copyright (c) 2002-2012, by ionCube Ltd., and
with Xdebug v2.2.0rc1, Copyright (c) 2002-2012, by Derick Rethans
but i havent tested debugging with files containing ioncube encoded content yet.