Internal Server Error with using guzzle
When I use Laragon with Guzzle 6.2. I'm currently getting a Internal Server Error.
Laragon: 2.0 160708
@dragonfire1119 : Check your Apache's error.log to figure what causes the issue.
Thanks for the quick response.
I have created a fresh site with only a index.php & composer with guzzle installed. I'm getting the Internal Error. Checked with error.log: End of script output before headers: index.php
<?php require 'vendor/autoload.php'; $http = new GuzzleHttp\Client; $response = $http->get('http://httpbin.org/get'); return json_decode((string) $response->getBody(), true);
Started up a
php -S localhost:8000everything works. It's only happening with Laragon.
It seems Guzzle doesn't work well with PHP FastCGI. I suggest:
- Update to Laragon version 2.0.5
- Check if your PHP is Thread Safe (on the title bar)
Yes my PHP is thread safe: enabled. Updated to 2.0.5 & it's working? What changed?
Thanks for your help! Really appreciate it!
Cool! Changing from PHP FastCGI to mod_php solved guzzle issue. Some libraries are not well-tested with both mod_php and PHP FastCGI.