Info
- 3 posts
- 2 voices
- Started 2 years ago by kehlers
- Latest reply from Ben L.
- This topic is not resolved
[resolved] Error on PHP 5.3
-
- Posted 2 years ago #
Does anyone else get this error in the forum when you have upgraded to PHP 5.3.0? I know this is due to many deprecated features in this version of PHP. Does a recent version of bbPress correct it?
Strict Standards: Creating default object from empty value in /<<pathname>>/forum/config.php on line 15 -
- Posted 2 years ago #
Seemed to have solved this, so I'll post the answers for anyone else who has this problem.
PHP 5.3+ now requires you to define an object explicitly (
$object = new className();). The$bbvariable in older versions of bbPress is an object which is implicitly defined in config.php. Thus, if you define it explictly as an object of type stdClass, the error goes away, like so:
$bb = new stdClass();
WARNING: I have not fully tested this, so use at your own risk.However, I also noted that in bbPress 1.0.2, the whole $bb object seems to be deprecated, so it is likely that if you upgrade to the newest version, the errors will also go away. I can't upgrade just yet, so I haven't tried this either.
Cheers!
-
- Posted 2 years ago #
It's already in the code - http://phpxref.ftwr.co.uk/bbpress/bb-load.php.source.html#l153
You should really update to the latest version - it has multiple security fixes over your version.(And btw, config.php is deprecated - bb-config.php is where it's at!)
-
You must log in to post.