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

Is worker mode broken??? #100

Closed
withinboredom opened this issue Nov 10, 2022 · 3 comments
Closed

Is worker mode broken??? #100

withinboredom opened this issue Nov 10, 2022 · 3 comments

Comments

@withinboredom
Copy link
Collaborator

PHP file

// public/worker.php
<?php

do {
	$running = frankenphp_handle_request(
		function () {
			echo "hello world";
		}
	);
} while ($running);

Then:

docker run --rm -e FRANKENPHP_CONFIG="worker ./public/worker.php" -p 80:80 -p 443:443 -v $(pwd):/app -w /app dunglas/frankenphp

When I curl localhost, it just hangs forever. @dunglas, can you reproduce this or am I doing something wrong?

@dunglas
Copy link
Owner

dunglas commented Nov 11, 2022

No issue on my side with the latest version of the image:

docker pull dunglas/frankenphp
docker run --rm -e FRANKENPHP_CONFIG="worker ./public/worker.php" -p 80:80 -p 443:443 -v $(pwd):/app -w /app dunglas/frankenphp

image

@withinboredom
Copy link
Collaborator Author

aha, I was missing the worker.php part. I thought worker ./public/worker.php implied it was to run worker.php for every request.

@dunglas
Copy link
Owner

dunglas commented Nov 12, 2022

Ok got it! So there is a bug: a 404 should be thrown, the server should not hang.

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