Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

argonzalez's avatar

cURL issues with sail and localhost

I use laravel sail.

When I run this script

$response = Http::get('http://localhost');
dump($response->body());

from the CLI or in a Laravel command, i get the proper dump.

When I run this same script from the broswer, it just hangs.

I believe this has to do with cURL. When i run this script

exec('curl http://localhost', $output);
dump($output);

i get the same exact results. From CLI, it works, from browser, it hangs.

When I ran some more debugging I noticed curl being from php in the browser is just returning lots of 0byte packets nonstop.

What could be the fix to get this running in the browser?

0 likes
0 replies

Please or to participate in this conversation.