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

Interactive session fails to start when running php-fpm in foreground #440

Closed
mvasin opened this issue Nov 17, 2017 · 5 comments
Closed

Comments

@mvasin
Copy link

mvasin commented Nov 17, 2017

I use docker to run nginx, mysql and php-fpm all in separate containers. And I start php-fpm container not with php-fpm command, but with sleep 1000000, then log in into that container and run php-fpm interactively. Unfortunately, it fails start interactive session:

root@92ce84f482a5:/var/www# php-fpm -F
[17-Nov-2017 07:30:39] NOTICE: fpm is running, pid 135
[17-Nov-2017 07:30:39] NOTICE: ready to handle connections
[17-Nov-2017 07:30:46] WARNING: [pool www] child 136 said into stdout: "Psy Shell v0.8.15 (PHP 7.1.11 — fpm-fcgi) by Justin Hileman"
[17-Nov-2017 07:30:46] WARNING: [pool www] child 136 said into stdout: ""
[17-Nov-2017 07:30:46] WARNING: [pool www] child 136 said into stdout: "From mu-plugins/for-the-visually-impaired/for-the-visually-impaired.php:375:"
[17-Nov-2017 07:30:46] WARNING: [pool www] child 136 said into stdout: ""
[17-Nov-2017 07:30:46] WARNING: [pool www] child 136 said into stdout: "    373| $imgsz=array('1'=>"16",'2'=>"24",'3'=>"41",'4'=>"58");"
[17-Nov-2017 07:30:46] WARNING: [pool www] child 136 said into stdout: "    374| 	$color = '#FF0000';"
[17-Nov-2017 07:30:46] WARNING: [pool www] child 136 said into stdout: "  > 375|   eval(\Psy\sh());"
[17-Nov-2017 07:30:46] WARNING: [pool www] child 136 said into stdout: "    376| 	$custom_css = ""
[17-Nov-2017 07:30:46] WARNING: [pool www] child 136 said into stdout: "    377| 		.vi-on-img-button{"
[17-Nov-2017 07:30:46] WARNING: [pool www] child 136 said into stdout: ""
[17-Nov-2017 07:30:46] WARNING: [pool www] child 136 said into stdout: ""
[17-Nov-2017 07:30:46] WARNING: [pool www] child 136 said into stdout: "Exit:  Ctrl+D"
172.24.0.2 -  17/Nov/2017:07:30:45 +0000 "GET /index.php" 200

I wonder if it's possible to use php-fpm to debug interactively this way. I see that readme says apache/nginx is not supported, but it's not remote debugging.

If it's not possible by now, I guess it makes sense to mention in the readme that starting php-fpm in foreground also won't let you debug.

@bobthecow
Copy link
Owner

Yeah, even running in the foreground like this, rather than a daemon, php-fpm isn't running the actual PHP process. It's a process manager running a pool of processes.

In order to work interactively, psysh must be the active process, or must be run by a process that pipes stdin and stdout to and from psysh. php-fpm doesn't do that, apache doesn't do that, and nginx doesn't do that, even if you're running them in the foreground.

@bobthecow
Copy link
Owner

The documentation has been updated to include PHP-FPM :)

@mvasin
Copy link
Author

mvasin commented Nov 25, 2017

Sounds good, @bobthecow! Can you please give a link?

@bobthecow
Copy link
Owner

I just updated the "Usage" section to include PHP-FPM as "unsupported":

Unfortunately, debugging through a web server like Apache or nginx or PHP-FPM is also not supported. Debugging is only supported when running PHP scripts from the command line or through PHP's built-in web server. If you're interested in helping add this functionality, see Github issue 121.

@mvasin
Copy link
Author

mvasin commented Nov 25, 2017

Okay, now it's clear.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants