Fatal error: Call to undefined function: file_put_contents() in /...../sites/all/modules/fetchgals/fetchgals.module on line 317

Comments

pobster’s picture

Status: Active » Closed (fixed)

From October 22, 2006 - 22:06 in this very same issue queue;

http://drupal.org/node/90713

Which I found by using Google. It's the second result returned and the only one on that page from the Drupal.org website...

Sorry but I'm really not interested in maintaining PHP4 compatibility. If you're unsure about what to do and you're not bothered about having logs (which to be honest, I'd forgotten were written that way, I'll probably change that to be site specific for future releases) then just comment out all (four?) lines which use file_put_contents. You'll just lose the logs being written to and also you'll have to manually alter the tgps file yourself, but meh - that's not much hardship and most people will never alter theirs anyway!

To comment something out you simply prefix the line with //, eg. line 317;

// $output = file_put_contents(FG_CWD .'log', '');

In case you're confused by the jargon, to comment something out means that you make the line a 'comment' (informational) rather than a line of code. So the line stays intact, it just doesn't have any effect any more (it's ignored). It's better to do this rather than delete the line as;

1. If you ever need to change something referred to by line number, then your lines will be numbered correctly still.
2. If you upgrade to PHP5.x then you can simply uncomment the lines to regain the functionality.

Hope this helps.

Pobster

Gunderstorm’s picture

It does indeed help.

I appreciate your time and the quick response.

I did do a search on this error string, but I realize now that I must have included the filepath specific to my site. I apologize for being too quick to post an issue.

Thanks much!