Apr 9, 2023
0
Level 4
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?
Please or to participate in this conversation.