Internal Server Error with using guzzle


  • | 675 points

    When I use Laragon with Guzzle 6.2. I'm currently getting a Internal Server Error.

    Laragon: 2.0 160708
    Apache: 2.4.23
    PHP: 7.0.0
    Laravel 5.3


  • administrators
    | 66609 points

    @dragonfire1119 : Check your Apache's error.log to figure what causes the issue.


  • | 675 points

    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:8000 everything works. It's only happening with Laragon.


  • administrators
    | 66609 points

    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)

  • | 675 points

    Yes my PHP is thread safe: enabled. Updated to 2.0.5 & it's working? What changed?

    Thanks for your help! Really appreciate it!


  • administrators
    | 66609 points

    Cool! Changing from PHP FastCGI to mod_php solved guzzle issue. Some libraries are not well-tested with both mod_php and PHP FastCGI.


Log in to reply
 

Looks like your connection to Laragon was lost, please wait while we try to reconnect.