10/06/08

Permalink 07:41:02 pm, by robertc Email , 326 words, 1258 views   English (UK)
Categories: Web Develop, Server Side Web Development Share on reddit Share on digg Share on del.icio.us Share on ma.gnolia.com Share on StumbleUpon

Fixing WackoWiki for PHP 5

For a long time now, I've had a WackoWiki implementation on my (not so technical) personal site. It was upgraded from a WikkaWiki which was installed back in March 2003, which makes it about four months older than this blog :)

Anyway, the point is it's a legacy app, which has never been a problem for a little used website until I discovered (last night) that the hosting company was doing an upgrade on all the servers which would remove PHP 4 to leave only PHP 5. A quick check indicated Wacko R4.2 was supposed to be PHP 5 compatible, so I didn't worry too much about it and went to bed. Of course, when I checked this morning, it was broken, just a blank page...

I downloaded the error log and found a few entries like this:

[error] [client www.xxx.yyy.zzz] PHP Catchable fatal error: Object of class Wacko could not be converted to string in wakka/wakka.php on line 254

A quick Google revealed a number of other WackoWiki installs with a similar problem, but also this more useful result which explained the change in PHP 5.2 which was causing the problem:

Changed __toString() to be called wherever applicable. The magic method __toString() will now be called in a string context, that is, anywhere an object is used as a string. The fallback of returning a string that contains the object identifier was dropped in PHP 5.2.0. It became problematic because an object identifier cannot be considered unique. This change will mean that your application is flawed if you have relied on the object identifier as a return value. An attempt to use that value as a string will now result in a catchable fatal error.

Line 254 of wakka.php is:

$cache->Log("Before Run wacko=".$wacko);

I'm not sure what it's supposed to be doing, but it didn't seem too critical, so I just removed the object reference:

$cache->Log("Before Run wacko=");

Seems to work for me!

Technorati tags for this post:

Trackback address for this post:

http://www.boogdesign.com/b2evo/th1srv/trackback.php/242

Comments, Trackbacks, Pingbacks:

Comment from: Devon Young [Visitor] · http://devonyoung.com/
Nice little hack there. Makes me wonder what that line does in the whole scheme of the app, if it can be removed without any apparent consequence.
PermalinkPermalink 11/06/08 @ 03:24
Comment from: robertc [Member] Email · http://www.boogdesign.com/
I'm assuming it's some sort of debugging/logging thing and therefore not at all crucial - just logs the fact that the base object got created correctly.

Rob
PermalinkPermalink 11/06/08 @ 07:33
Comment from: kubi [Visitor] Email · http://www.svenkubiak.de
I had the same problem and adjusted the code. But the Wiki still displays a blank page. Any suggestions?
PermalinkPermalink 31/07/08 @ 12:03
Comment from: robertc [Member] Email · http://www.boogdesign.com/
I'm not sure, there might be a caching issue of some kind? Are you able to get access to your error log? Depending on your particular configuration, this will either be through your CPanel (or similar) interface, or PHP will create it's own error log in your web root.

These days most PHP installations are configured not to show error messages by default but to log them instead, if you can find the error message then the problem should be easy enough to track down.

Rob
PermalinkPermalink 03/08/08 @ 12:35

Leave a comment:

Your email address will not be displayed on this site.
Your URL will be displayed.

Allowed XHTML tags: <p, ul, ol, li, dl, dt, dd, address, blockquote, ins, del, span, bdo, br, em, strong, dfn, code, samp, kdb, var, cite, abbr, acronym, q, sub, sup, tt, i, b, big, small>
(Line breaks become <br />)
(Set cookies for name, email and url)
(Allow users to contact you through a message form (your email will NOT be displayed.))

Hot Topics

    Popular

    boogdesign posts

    Longer posts on standards based web design, portable web development and Linux, intermingled with some stuff on my other nerd interests.

    Search

    Syndicate this blog XML

    • RSS 0.92 Posts RSS 0.92 Comments
    • RSS 1.0 Posts RSS 1.0 Comments
    • RSS 2.0 Posts RSS 2.0 Comments
    • Atom Posts Atom Comments
    What is RSS?

    License info

    Creative Commons License
    This work is licensed under a Creative Commons Attribution-Share Alike 2.5 License.

    powered by
    b2evolution

    get hCard