For Security Reasons, Dreamhost has disabled fopen in PHP scripts. So this module doesn't seem to work... When I try to go to the page oc-tech.org/flickr I get errors in my header:

warning: fopen(): URL file-access is disabled in the server configuration in /home/.jamocha/odb/oc-tech.org/modules/flickr.module on line 167.

warning: fopen(http://...@N00): failed to open stream: no suitable wrapper could be found in /home/.jamocha/odb/oc-tech.org/modules/flickr.module on line 167.

warning: fread(): supplied argument is not a valid stream resource in /home/.jamocha/odb/oc-tech.org/modules/flickr.module on line 169.

warning: fclose(): supplied argument is not a valid stream resource in /home/.jamocha/odb/oc-tech.org/modules/flickr.module on line 174.

Then the content of the page reads:

An error occurred
Somehow we were unable to parse the response. Please contact the site owner for investigation.
flickr.module BETA.3, by Jonas M Luster

A similar problem was solved in PHPlist by the user "Funkypenguin". Details of his patch are here:

http://www.funkypenguin.co.za/using_phplist_on_dreamhost
http://www.funkypenguin.co.za/fopen_vs_curl_on_dreamhost_-_revisited

So a CURL patch would be useful.

CommentFileSizeAuthor
#5 flickr.module.patch_0.txt875 bytesslower
#3 flickr.module.patch.txt760 bytesslower

Comments

Thox’s picture

Do you know if fsockopen() works? If so, the module could be patched to use drupal_http_request() instead.

dnorman’s picture

I just hit this as well. Keep getting this error on my /flickr page:

* warning: fopen(): URL file-access is disabled in the server configuration in /home/.cruncher/dnorman/darcynorman.net/modules/flickrmodule/flickr.module on line 180.
* warning: fopen(http://...@N01): failed to open stream: no suitable wrapper could be found in /home/.cruncher/dnorman/darcynorman.net/modules/flickrmodule/flickr.module on line 180.
* warning: fread(): supplied argument is not a valid stream resource in /home/.cruncher/dnorman/darcynorman.net/modules/flickrmodule/flickr.module on line 182.
* warning: fclose(): supplied argument is not a valid stream resource in /home/.cruncher/dnorman/darcynorman.net/modules/flickrmodule/flickr.module on line 187.

Any ideas?

slower’s picture

StatusFileSize
new760 bytes

Here is a cURL patch for all of us Dreamhosters that don't have access to allow_url_fopen.

Tobias Maier’s picture

Status: Active » Needs review
slower’s picture

StatusFileSize
new875 bytes

Since not everyone will neccessarily have cURL installed, I put the cURL bit into a "function_exists" conditional which defaults to the "file_get_contents" method.

wnoronha’s picture

Status: Needs review » Fixed

Issue fixed. Dream host users get slower a beer for fixing it.

Anonymous’s picture

Status: Fixed » Closed (fixed)