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

Support hosts that disable fpassthru() #41

Open
avdi opened this issue Jul 18, 2024 · 2 comments
Open

Support hosts that disable fpassthru() #41

avdi opened this issue Jul 18, 2024 · 2 comments

Comments

@avdi
Copy link

avdi commented Jul 18, 2024

Cloudways disables fpassthru(), and some cursory research indicates that others such as Flywheel do as well.

I put this dreadful kludge in my cache-config.php but it might be nice if Surge detected and coped with a missing fpassthru():

function fpassthru($stream) {
	echo stream_get_contents($stream);
}
@kovshenin
Copy link
Owner

Thanks @avdi! I'll look into this more.

I spoke with a few hosting providers that disabled fpassthru a couple of years ago and none of them had a good reason other than "probably because a similarly named passthru is disabled". Worth reaching out to support to ask about it and possibly enabling it, but I will definitely look into stream_get_contents to see if it's a good fit/alternative.

@avdi
Copy link
Author

avdi commented Sep 5, 2024

Thanks so much! My understanding is that stream_get_contents will never be as performant as fpassthru, so it's probably best to keep fpassthru as the default when it's available. But having the alternative would be nice!

I spoke with a few hosting providers that disabled fpassthru a couple of years ago and none of them had a good reason other than "probably because a similarly named passthru is disabled". Worth reaching out to support to ask about it and possibly enabling it, but I will definitely look into stream_get_contents to see if it's a good fit/alternative.

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