drupal plugin worked great, then didn't work after migration

5 views
Skip to first unread message

Evan Williams

unread,
May 20, 2009, 11:38:35 AM5/20/09
to geon...@googlegroups.com

I'm trying to debug a drupal site using the geonames plugin. The geonames stuff worked perfectly, then the hosting went to a faster server and geonames didn't work.

The people who did the migration copied the files and did an export of the database. The faster host is a different os and a more recent mysql.

Here's what I'm seeing in the logs

May 20 09:28:14 223943-web1 drupal: http://example.com|1242829694|php|0|66.249.71.26|http://example.com/stockholms-l%C3%A4n/2673722|||file_get_contents() [<a href='function.file-get-contents'>function.file-get-contents</a>]: URL file-access is disabled in the server configuration in /var/www/production/modules/contrib/geonames/geonames.module on line 175.
May 20 09:28:14 223943-web1 drupal: http://example.com|1242829694|php|0|66.249.71.26|http://example.com/stockholms-l%C3%A4n/2673722|||file_get_contents(http://ws.geonames.net/hierarchy?username=example&geonameId=0000000&app=drupal) [<a href='function.file-get-contents'>function.file-get-contents</a>]: failed to open stream: no suitable wrapper could be found in /var/www/production/modules/contrib/geonames/geonames.module on line 175.

Note that I made some edits to this. It's not really example.com and the geonameid is not 00000000, but you get the idea.

This is php 5.2.9, 64 bit Linux vers 2.6.18-128.1.6.el5, redhat, mysql Ver 14.12 Distrib 5.0.45, geonames plugin looks like 5.x-1.x-dev, Apache/2.2.3 and Drupal 5.9.

I have little experience with either the plugin or geonames in general. Advice would be a huge good deed.

Thanks,
-- 
Evan Williams

Anthony Cartmell

unread,
May 20, 2009, 4:52:29 PM5/20/09
to geon...@googlegroups.com
Evan,

> URL file-access is disabled in the server configuration

This is the problem. You'll need to enable URL file access in the server
configuration or re-write the module to use something else to access
remote files, perhaps cURL. The module is using file_get_contents() on
line 175 with a URL filename. This sort of thing is sometimes disabled to
make your PHP application a little more secure from malicious filename
arguments.

HTH,

Anthony
--
www.fonant.com - Quality web sites

Evan Williams

unread,
May 20, 2009, 6:50:30 PM5/20/09
to geon...@googlegroups.com


Anthony,

I fixed the php.ini and it worked perfectly. Thanks so much. I write big hairy lisp programs all day, and php is opaque to me. I'm grateful for your help.
-- 
Evan
Reply all
Reply to author
Forward
0 new messages