Download & Extend

Flickr Module Needs Patch to work on Dreamhost

Project:Flickr Module
Version:master
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

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.

Comments

#1

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

#2

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?

#3

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

AttachmentSize
flickr.module.patch.txt 760 bytes

#4

Status:active» needs review

#5

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.

AttachmentSize
flickr.module.patch_0.txt 875 bytes

#6

Status:needs review» fixed

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

#7

Status:fixed» closed (fixed)