-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Xdebug breaks on access to class static property #133
Comments
Same here, tested with 5.5.x and 5.6.x with various versions of xdebug. |
Same here, with 5.3, 5.4, 5.5 always newest cgi version self compiled - now using the Zend-Debugger which drives me crazy because it's that slow :-( |
Any idea on the cause of the problem and how we could fix the images? |
Just a "me too" from here. Been driving me nuts for a couple of days. |
Welcome me to the club as well. |
Same issue here with the following Dockerfile
|
Presumably xdebug is a remote debugger what os and version is the debug client connecting to on the containers debug server port (9000). Got some questions: @jfilipczyk how are your referencing xdebug.ini? host volume mapping? Your xdebug setup differs slightly from @parrisvarney because you're using what looks like the docker0 as a static ip xdebug client. @parrisvarney your path to xdebug differs from @jfilipczyk is that normal? Probably unrelated, but has anyone tried UNIX socket option instead of TCP? You can map UNIX sockets using -v. |
@booyaa I've never seen the xdebug path configured as a relative path, but I don't think that's the issue since if it's incorrect the remote debugger wouldn't work at all. The issue we're seeing is that a seemingly incorrect fatal error arises during run time when a value is assigned to a static class member. This only happens when a breakpoint is set the in the file containing that assignment. Both the php program and xdebug behave normally if the breakpoint is not set. This issue started last week for me when I switched from a custom Vagrant box build to this premade Docker build, at the same time upgrading from php5.3 to php5.6. The work around is easy enough for me since the error occurs in a config file (don't place a breakpoint), but the scenario is similar enough to what @jfilipczyk is experiencing that I figured I'd add my use case. |
I have the same issue without a docker. |
As noted before, this effect only happens in the official PHP 5 docker builds. When building a PHP 5 container from jessie or a recent ubuntu, xdebug works just fine. |
+1. It is happening on the official 5.6 image |
+1 =( |
👍 Any workaround? |
There is no known workaround except switch to a different image. To describe the issue in more detail this only happens after the first breakpoint of a static type. Hitting next breakpoint simple breaks xdebug on this image. I would love to correct the code with this image but I do not know where to begin as I have never seen an issue as described above. |
@codeorganic which image i can use as alternative? |
@codeorganic having a suggested alternative would be helpful.
In relation to that statement, I'm pretty sure I tried setting breakpoints that were before the static variable reference and was able to step through the code until it hit the static reference. @ihor-sviziev When I ran across this bug about 2 weeks ago, I switched to a custom container. I don't guarantee it's bug-free. It's also somewhat customized to our own development environment and subject to change as our development needs change. It may be a helpful jump-off point, though. |
@ihor-sviziev you also may start with a recent debian or ubuntu container and just install your desired PHP version and extensions via Dockerfile. Works pretty well for me. |
@willydee could you send your Dockerfile where xdebug works good for you? |
Sure. This is for PHP 5.6; for the latest PHP 7 you may use the official image, which does not show this debugging misbehaviour.
|
I've contacted with Derick Rethans (Xdebug developer), gived him information about this issue and he was able to reproduce this issue and gave following response:
I'll try to prepare Dockerfile with that workaround little bit later. I hope it will help us. Derick also reported bug to PHP: https://bugs.php.net/bug.php?id=73545 |
The fix has been committed.
|
Looks like this fix pushed to master & php-5.6 branches. I hope it will be included to 5.6.29. |
Unfortunately that fix wasn't added to 5.6.29. Waiting for next release... |
That commit was included to 5.6.30, but this issue still reproducing =( |
As I could reproduce this without Xdebug in the mix, I don't think there is much I can do about it. |
This is a deal breaker for 5.6.3... Could we mention this issue in the readme? |
@ihor-sviziev Are you sure it was the same problem again? |
The below worked for me:
Previous to this I had: |
@derickr If that question was actually meant for me, yes same issue (Fatal error upon access of static class property). |
Just another "same here" from my side. PHP 5.6.30 |
If it's helpful to anyone, I've made https://github.com/chrissound/dockercompose_phpapachemysql_ubuntu You're able to install Xdebug following vanilla Ubuntu instructions. |
…ass static property
bingo. Same here .
|
@nei did you try my solution a bit further up? |
I'm closing given the solution posted above in #133 (comment) -- this doesn't seem to be an issue specific to our images, but rather the combination of Jessie's compiler + PHP + Xdebug. Since then, PHP has been updated with a fix, and some images are on Stretch (#504). For further discussion of this topic, I'd recommend posting to the Docker Community Forums, the Docker Community Slack, or Stack Overflow in order to capture a wider user base. Thanks! |
I'm looking for a workaround for php 5.4 |
Still had this problem on PHP 5.6.40. Constructed the following for my Dockerfile (basing off of official PHP image):
Now works. Hope this solution helps someone that wishes to keep using the official PHP images. Saw a comment that it only affects Debian 'jessie', but had no luck with 'stretch' either :( |
Same problem with php:5.4.45-apache and pecl install xdebug-2.4.1 & docker-php-ext-enable xdebug. Guess i have to build the image myself... |
Uses workaround detailed in github.com/docker-library/php/issues/133 to compile Xdebug from source with different args. Allows debugging of code involving static properties without errors.
Note to all 👍 this from @Wilkolicious is the solution. it works on PHP 5.6 on Debian 8 (and even for PHP 5.3 on Debian 8) |
The solution from Wilkolicious worked for me on PHP 5.4.45 and Xdebug 2.4.1 on Debian Jessie, docker image I still needed to do BEFORE
AFTER
|
I've a problem with xdebug in my dev environment
Xdebug settings:
Everything works good but one thing. When debbuging code:
If i set breakpoint on
self::$a = 123;
or step into the line then i get:If i don't step into that line debugging session continous without any problem.
I tried different xdebug versions, different debug clients (PhpStorm and Netbeans), different ways to install xdebug (pecl, compile from source). Nothing worked. I believe there is some problem in the the official image.
The text was updated successfully, but these errors were encountered: