boogdesign posts
10/06/08
Categories: Web Develop, Server Side Web Development
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!
Trackback address for this post:
http://www.boogdesign.com/b2evo/th1srv/trackback.php/242
Comments, Trackbacks, Pingbacks:
Rob
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
Leave a comment:
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
Categories
- All
- General (13)
- Linux (42)
- Debian / Ubuntu (5)
- Fedora / Red Hat (17)
- Gentoo (5)
- SuSE (12)
- Semantic Web and Microformats (5)
- Web Design (21)
- Web Develop (40)
Archives
- June 2008 (5)
- May 2008 (3)
- April 2008 (3)
- March 2008 (3)
- November 2007 (2)
- October 2007 (3)
- August 2007 (1)
- July 2007 (2)
- June 2007 (8)
- May 2007 (3)
- April 2007 (2)
- March 2007 (4)
- More...



