Hi,

I'm trying rlisting and following problem occurs when trying to upload photos in the "edit gallery" tab:

warning: file_get_contents() [function.file-get-contents]: URL file-access is disabled in the server configuration in /my_site/sites/all/modules/home/home.module on line 656.

* warning: file_get_contents(http://maps.google.com/maps/geo?q=street+lincoln%2CWashington%2CNY%2CU.S...) [function.file-get-contents]: failed to open stream: no suitable wrapper could be found in /my_site/sites/all/modules/home/home.module on line 656.

I know they're probably related to server restrictions, however is there a chance to avoid these functions?

Comments

suoko’s picture

Sorry for previous post:
here are the errors

* warning: file_get_contents() [function.file-get-contents]: URL file-access is disabled in the server configuration in /my_site/sites/all/modules/rlisting/listing/ListingMap.class.php on line 132.
* warning: file_get_contents(http://maps.google.com/maps/geo?&q=street%20lincoln%20Washington%20%2050...) [function.file-get-contents]: failed to open stream: no suitable wrapper could be found in /my_site/sites/all/modules/rlisting/listing/ListingMap.class.php on line 132.

kenuck’s picture

Status: Active » Closed (won't fix)

It's trying to get the lat an long from google for the map display. You'll need to comment out that block of code or change your server access setting :)
cheers

faunapolis’s picture

I am very sorry for writing this on a 'won't fix' issue, but I had exactly the same issue. My host is dreamhost, and they have disabled the PHP option allow_url_fopen.

I have been learning PHP thanks to drupal, so I just wanted to post my solution to the problem if anybody has the same problem in the future, or in case the maintainers want to add a workaround to this excellent module.

The problem is solved (in the case of dreamhost) using the cURL option:

Insert the following code after "$_result = false;" in line 130:

$ch = curl_init();
$timeout = 5; // set to zero for no timeout
curl_setopt ($ch, CURLOPT_URL, $_url);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$file_contents = curl_exec($ch);
curl_close($ch);

replace the line 132 (of course, after you inserted the previous code it would move) with:

       	if($_result = file_get_contents($_url)) {

with:

       	if($_result = $file_contents) {

sorry I can't provide this as a patch since I don't know how to do it. A full explanation of the cURL option from dreamhost here: http://wiki.dreamhost.com/CURL

earth’s picture

that seems to resolve one of the issues I was having with the rlsting google map issue as described here, a dreamhost client as well!

Not to go off topic, was wondering if anyone else is having issues with the thumbnails being viewable on all pages in the featured block, as the path to the images is not correct for the node_images...if so, there is a thread started to respond to and support request at rlisting!

thanks faunapolis for the fix!

Project: » Lost & found issues

This issue’s project has disappeared. Most likely, it was a sandbox project, which can be deleted by its maintainer. See the Lost & found issues project page for more details. (The missing project ID was 199796)