egeloen / IvoryGoogleMapBundle

Google Map API v3 integration for your Symfony2 project.
https://github.com/egeloen/ivory-google-map
MIT License
217 stars 152 forks source link

Provider::buildGeocoderResponse() must be an instance of stdClass, null given #25

Closed JaviereN closed 12 years ago

JaviereN commented 12 years ago

Hello,

First thanks for reading. In my localhost all is working fine but in my production server i get this error:

Catchable Fatal Error: Argument 1 passed to Ivory\GoogleMapBundle\Model\Services\Geocoding\Provider::buildGeocoderResponse() must be an instance of stdClass, null given, called in /usr/home/ongcarmel.net/web/carmelitas/vendor/bundles/Ivory/GoogleMapBundle/Model/Services/Geocoding/Provider.php on line 137 and defined in /usr/home/ongcarmel.net/web/carmelitas/vendor/bundles/Ivory/GoogleMapBundle/Model/Services/Geocoding/Provider.php line 243

It's probably caused by a misconfiguration, but I can not find the problem.

egeloen commented 12 years ago

IMO, your production server does not receive any response from google API. If you can debug from this line, that can be very usefull !

JaviereN commented 12 years ago

The issue is in the file_get_contents function (https://github.com/kriswallsmith/Buzz/blob/master/lib/Buzz/Client/FileGetContents.php#L45) because allow_url_fopen is disabled on my server.

Can i configure the bundle in config.yml to use curl (https://github.com/kriswallsmith/Buzz/blob/master/lib/Buzz/Client/Curl.php) instead of file_get_contents??

Thanks again :)

egeloen commented 12 years ago

I will ask you tonight. I have no time currently.

JaviereN commented 12 years ago

Thx ;)

egeloen commented 12 years ago

If you take a look at the documentation, you see a section call adapter in the config. If you want to use buzz instead of curl for example, you need to config the adapter like that:

ivory_google_map:
    geocoder:
        adapter: "Geocoder\HttpAdapter\BuzzHttpAdapter"

Available adapters are:

Hope that help !

JaviereN commented 12 years ago

Using "Geocoder\HttpAdapter\CurlHttpAdapter" works perfect! Great egeloen ;) thanks again