Character Browser Character Browser Error with PHP 5.3.x
Reply
Character Browser Error with PHP 5.3.x
Just updated my server over the weekend and PHP was updated to 5.3.3-r1 and now my character browser will not display character pages anymore. Instead I get a white page, but I get the following in my apache error log:

More +
PHP Fatal error:  Cannot redeclare lcfirst() in item.php on line 51


Note: I have abbreviated the error by removing my absolute paths and just gave the file name it was complaining about.

A bit of Googling for "Cannot redeclare lcfirst()" turned up this post:

http://www.phpnuke-clan.net/modules.php?name=Forums&file=viewtopic&p=27243

most of the other sites were just bad pages with the error displayed that google cached.
Tue Nov 02, 2010 7:12 pm
lcfirst is a common function in a bunch of languages. It wasn't in php before 5.3.0. I added it, and then they added it. So it's being declared in two different spots. Normally I would just say delete it, but the problem is that I named it wrong. PHP's lcfirst turns "BLAH" into "bLAH", my terribly named lcfirst turns "BLAH" into "Blah".

Go into include/item.php. Do a search for "lcfirst", and replace it with "strtolower_ucfirst".

EDIT: you also might navigate around the tool a little and see if there are any other similar problems after you change it.

Then come back and let me know it worked so I can't point other people in the right direction =)
Tue Nov 02, 2010 7:21 pm
Project Lead
Seems to have fixed the issue, thanks.

Edit: Note there were a few entries so make sure to do a replace all, not just the first one.
Wed Nov 03, 2010 8:15 am
Sure : )
Wed Nov 03, 2010 8:16 am
Project Lead
Character Browser Character Browser Error with PHP 5.3.x
Reply