Skip to content
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 on Workspace Container #1027

Closed
Euthimios opened this issue Jun 19, 2017 · 10 comments
Closed

Xdebug on Workspace Container #1027

Euthimios opened this issue Jun 19, 2017 · 10 comments
Labels

Comments

@Euthimios
Copy link

Euthimios commented Jun 19, 2017

Info:

  • Docker version ($ docker --version): Docker version 1.12.6
  • Laradock commit ($ git rev-parse HEAD): c35445b
  • System info (Mac, PC, Linux): Linux
  • System info disto/version: UBUNTU 16.10

Issue: Xdebug on Workspace Container

What seems to be going wrong?

I can't install xdebugger on workspace container . i am following the instructions and i set the

WORKSPACE_INSTALL_XDEBUG=true

but when i execute the command : docker-compose build workspace php-fpm
the workspace container throw the bellow :

**After this operation, 3,720 kB of additional disk space will be used.
Err:1 http://ppa.launchpad.net/ondrej/php/ubuntu xenial/main amd64 php-xdebug amd64 2.5.1-1+deb.sury.org~xenial+1
404 Not Found
W: --force-yes is deprecated, use one of the options starting with --allow instead.
E: Failed to fetch http://ppa.launchpad.net/ondrej/php/ubuntu/pool/main/x/xdebug/php-xdebug_2.5.1-1+deb.sury.org~xenial+1_amd64.deb 404 Not Found

E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
ERROR: Service 'workspace' failed to build: The command '/bin/sh -c if [ ${INSTALL_XDEBUG} = true ]; then apt-get install -y --force-yes php-xdebug && sed -i 's/^;//g' /etc/php/7.1/cli/conf.d/20-xdebug.ini && echo "alias phpunit='php -dzend_extension=xdebug.so /var/www/vendor/bin/phpunit'" >> ~/.bashrc ;fi' returned a non-zero code: 100**


Expected behavior:

What should be happening instead?

to install xdebug to workspace container


Reproduce:

How might we be able to reproduce the error?

set WORKSPACE_INSTALL_XDEBUG=true
at the .env environment file


Relevant Code:

After this operation, 3,720 kB of additional disk space will be used.
Err:1 http://ppa.launchpad.net/ondrej/php/ubuntu xenial/main amd64 php-xdebug amd64 2.5.1-1+deb.sury.org~xenial+1
404 Not Found
W: --force-yes is deprecated, use one of the options starting with --allow instead.
E: Failed to fetch http://ppa.launchpad.net/ondrej/php/ubuntu/pool/main/x/xdebug/php-xdebug_2.5.1-1+deb.sury.org~xenial+1_amd64.deb 404 Not Found

E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
ERROR: Service 'workspace' failed to build: The command '/bin/sh -c if [ ${INSTALL_XDEBUG} = true ]; then apt-get install -y --force-yes php-xdebug && sed -i 's/^;//g' /etc/php/7.1/cli/conf.d/20-xdebug.ini && echo "alias phpunit='php -dzend_extension=xdebug.so /var/www/vendor/bin/phpunit'" >> ~/.bashrc ;fi' returned a non-zero code: 100

@NewbMiao
Copy link

NewbMiao commented Jun 22, 2017

Modify like this: apt-get -y update && apt-get install -y --force-yes php7.1-xdebug
(php7.1-xdebug for php71, for other php version, you can just change php{{version}}-xdebug )

Install php-xdebug after apt-get -y update , it's ok for me. Or maybe just update your laradock, the dockfile has changed now.

@benkelukas
Copy link

Hi,
@NewbMiao Could You please elaborate on this? I'm having same problem.
@Euthimios Did You manage to solve this? Seems we are not the only one affected #996

@fireproofsocks
Copy link

+1 on more clarification on this in the docs. If I edit the .env, rebuild via docker-compose down and docker-compose up -d, then hit my website in a browser, I can see xdebug in the phpinfo() output, but the xdebug module isn't loaded in the cli (php -m doesn't show xdebug).

The docs do not show any info on where to set the typical URL triggers for xdebug... so I would recommend that the docs include the bit about which container to log into and where to edit the options, e.g.

docker-compose exec php-fpm bash
vi /usr/local/etc/php/conf.d/xdebug.ini
# restart nginx / php-fpm

but, of course, I can't find an editor installed on that container (not vim, emacs, pico, nano, etc). So it's a long and windy homework assignment to figure out how this was intended to be used when an extra sentence or two could have saved many of us hours of time.

Furthermore...

I don't see any .php-fpm folder, so the entire section on http://laradock.io/guides/#enablePhpXdebug seems completely irrelevant. I've used xdebug for years and never gotten it to work with PHPStorm, even when working with folks from IDEA, so I'm amazed that section even exists in the docs for Laradock, let alone that it appears to describe a feature that actually works for someone (!!!).

@pavel-mironchik
Copy link
Contributor

@fireproofsocks , but why did you try to edit xdebug.ini IN container when docs clearly says

2 - Open laradock/workspace/xdebug.ini and laradock/php-fpm/xdebug.ini and enable at least the following configurations:
xdebug.remote_autostart=1
xdebug.remote_enable=1
xdebug.remote_connect_back=1

And about .php-fpm mention in docs - it is indeed mistake. There must be ./php-fpm folder which is laradock/php-fpm.

@fireproofsocks
Copy link

What docs are you reading @brunen9 ? The only xdebug info I've found http://laradock.io/guides/#enable-xdebug-on-php-fpm -- besides the error you confirmed, it says this:

If you have enabled xdebug=true in docker-compose.yml/php-fpm, xdebug will already be running when php-fpm is started and listening for debug info on port 9000.

which I don't think specifies anything about which host or folder where edits should be made... the only bit about the xdebug.ini seems to be in the wrong section (down by the firewall settings?). Regardless, I don't think the proper place to enable xdebug is in any docker-compose.yml file, is it? It looks like it's meant to be edited in the .env, no? But then what steps are required to recompile the containers with that extension enabled? Those are really the most important bits of information about using xdebug and they do not appear to be in the docs. What am I missing?

@pavel-mironchik
Copy link
Contributor

@fireproofsocks
Copy link

@brunen9 thanks! That would be a useful page to link to from the other section.

It seems that the laradock/php-fpm/xdebug has errors:

./xdebug start
./xdebug: line 100: syntax error: unexpected end of file

@pavel-mironchik
Copy link
Contributor

@fireproofsocks , in my case this file is fine and works, and line 100 is just empty line:

@stale
Copy link

stale bot commented Feb 2, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Stale label Feb 2, 2020
@stale
Copy link

stale bot commented Feb 23, 2020

Hi again 👋 we would like to inform you that this issue has been automatically closed 🔒 because it had not recent activity during the stale period. We really really appreciate your contributions, and looking forward for more in the future 🎈.

@stale stale bot closed this as completed Feb 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants