Flickr Module Needs Patch to work on Dreamhost
| Project: | Flickr Module |
| Version: | HEAD |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
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.

#1
Do you know if
fsockopen()works? If so, the module could be patched to usedrupal_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.
#4
#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.
#6
Issue fixed. Dream host users get slower a beer for fixing it.
#7