Installing phpBB3 on PHP 5.4.0

  • joebert
  • Sledgehammer
  • Genius
  • No Avatar
  • Joined: Feb 10, 2004
  • Posts: 13455
  • Loc: Florida
  • Status: Offline

Post July 11th, 2012, 3:28 pm

While trying to install phpBB3 on a Windows Vista computer that's running Apache 2.2.22 and PHP 5.4 I was getting an error about Strict Standards.

Quote:
Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in .\phpBB3\includes\utf\utf_tools.php on line 1781


Now, I haven't test driven the freshly installed forum further than the PHPinfo page to get those version numbers, but I did manage to get it installed by adding public static in front of all of the function definitions in "utf_normalizer.php". There was 3 or 4 of them I believe.

For instance, I replaced

Code: [ Select ]
function nfc(&$str)


with
Code: [ Select ]
    public static function nfc(&$str)
Strong with this one, the sudo is.
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post July 11th, 2012, 3:28 pm

  • Bigwebmaster
  • Site Admin
  • Site Admin
  • User avatar
  • Joined: Dec 20, 2002
  • Posts: 8922
  • Loc: Seattle, WA & Phoenix, AZ
  • Status: Offline

Post July 11th, 2012, 4:42 pm

I wonder if that would happen on Linux as well. If it is a PHP 5.4 change this is good to know as I plan to move towards that eventually once it becomes more stable. I am excited for some of the changes that come with PHP 5.4 as I mentioned over here.
Ozzu Hosting - Want your website on a fast server like Ozzu?
  • joebert
  • Sledgehammer
  • Genius
  • No Avatar
  • Joined: Feb 10, 2004
  • Posts: 13455
  • Loc: Florida
  • Status: Offline

Post July 11th, 2012, 5:52 pm

Ran into some more instances of this while setting up "Spambot Countermeasures". It's looking like a couple of ACP modules are affected. I'm guessing there's going to be some in the UCP and MCP modules.

//Edit -- The CAPTCHA is also affected, which will hamper registrations. I had to mark a few methods "public static" in captcha_factory.php and phpbb_captcha_gd_plugin.php to get it working.
Strong with this one, the sudo is.
  • Lomic
  • Newbie
  • Newbie
  • No Avatar
  • Joined: Jul 18, 2012
  • Posts: 5
  • Status: Offline

Post July 18th, 2012, 8:21 am

hi joebert,

could you please precise the methods you modified inside captcha_factory.php and phpbb_captcha_gd_plugin.php?

I first had the error with method utf_normalizer::nfc() which lead me to this board, and your code worked well, I tried to do the same with captcha_factory but it ended with other errors
  • joebert
  • Sledgehammer
  • Genius
  • No Avatar
  • Joined: Feb 10, 2004
  • Posts: 13455
  • Loc: Florida
  • Status: Offline

Post July 18th, 2012, 1:38 pm

The methods I changed in captcha_factory.php

Code: [ Select ]
    public static function &get_instance($name)
    public static function garbage_collect($name)
    public static function get_captcha_types()
  1.     public static function &get_instance($name)
  2.     public static function garbage_collect($name)
  3.     public static function get_captcha_types()


In phpbb_captcha_gd_plugin.php

Code: [ Select ]
    public static function &get_instance()
    public static function is_available()
    public static function get_name()
    public static function get_class_name()
    public static function acp_page($id, &$module)
  1.     public static function &get_instance()
  2.     public static function is_available()
  3.     public static function get_name()
  4.     public static function get_class_name()
  5.     public static function acp_page($id, &$module)


I've only tested it as far as getting basic user registrations working. The way I get my error notices when the CAPTCHA image isn't working is to save the image as "debug.txt", then open that in Notepad2 and read the error notices at the top of the file.
Strong with this one, the sudo is.
  • Lomic
  • Newbie
  • Newbie
  • No Avatar
  • Joined: Jul 18, 2012
  • Posts: 5
  • Status: Offline

Post July 23rd, 2012, 3:15 am

Thanks joebert! I will try on my board asap!
  • Zealous
  • Guru
  • Guru
  • User avatar
  • Joined: Apr 15, 2011
  • Posts: 1195
  • Loc: Sydney
  • Status: Offline

Post July 23rd, 2012, 5:33 am

would it not be better just to run it on a Linux environment, should be straight forward then.
  • joebert
  • Sledgehammer
  • Genius
  • No Avatar
  • Joined: Feb 10, 2004
  • Posts: 13455
  • Loc: Florida
  • Status: Offline

Post July 23rd, 2012, 1:57 pm

I don't think that has anything to do with it Zealous. This is more to do with the PHP developers imposing stricter rules on syntax in order to increase the performance of the PHP processor.
Strong with this one, the sudo is.
  • xoxoxoxox
  • Born
  • Born
  • No Avatar
  • Joined: Jul 27, 2012
  • Posts: 2
  • Status: Offline

Post July 27th, 2012, 10:34 am

Am trying to install phpbb but i got this error what do i do? am new to codes

STRICT STANDARDS: NON-STATIC METHOD UTF_NORMALIZER::NFC() SHOULD NOT BE CALLED STATICALLY IN E:\WAMP\WWW\PHPBB3\INCLUDES\UTF\UTF_TOOLS.PHP ON LINE 1781
  • xoxoxoxox
  • Born
  • Born
  • No Avatar
  • Joined: Jul 27, 2012
  • Posts: 2
  • Status: Offline

Post July 27th, 2012, 10:49 am

i was able to overcome previous error...this is a new error


STRICT STANDARDS: NON-STATIC METHOD UTF_NORMALIZER::NFKC() SHOULD NOT BE CALLED STATICALLY IN E:\WAMP\WWW\PHPBB3\INCLUDES\UTF\UTF_TOOLS.PHP ON LINE 1663
  • joebert
  • Sledgehammer
  • Genius
  • No Avatar
  • Joined: Feb 10, 2004
  • Posts: 13455
  • Loc: Florida
  • Status: Offline

Post July 27th, 2012, 2:48 pm

Here's the manual page for static methods/variables in PHP.
http://www.php.net/manual/en/language.oop5.static.php

Now, what those error messages you're getting mean, is that phpBB hasn't used that "static" keyword when defining the methods phpBB is using. What I have been doing is going through and adding that "static" keyword in the method definitions of the methods referred to.

Find that definition in utf8_normalizer.php, and make it static.
Strong with this one, the sudo is.
  • Lomic
  • Newbie
  • Newbie
  • No Avatar
  • Joined: Jul 18, 2012
  • Posts: 5
  • Status: Offline

Post July 28th, 2012, 1:51 am

joebert wrote:
The methods I changed in captcha_factory.php
[...]
In phpbb_captcha_gd_plugin.php
Hi joebert,

I tried your mods on my board but the result is not good for the moment:
Code: [ Select ]
Strict Standards: call_user_func() expects parameter 1 to be a valid callback, non-static method phpbb_recaptcha::is_available() should not be called statically in /home/root/site/forum/includes/captcha/captcha_factory.php on line 83

Strict Standards: call_user_func() expects parameter 1 to be a valid callback, non-static method phpbb_recaptcha::get_name() should not be called statically in /home/root/site/forum/includes/captcha/captcha_factory.php on line 89

Fatal error: Cannot redeclare class phpbb_captcha_gd in /home/root/site/forum/includes/captcha/plugins/old_phpbb_captcha_gd_plugin.php on line 163
  1. Strict Standards: call_user_func() expects parameter 1 to be a valid callback, non-static method phpbb_recaptcha::is_available() should not be called statically in /home/root/site/forum/includes/captcha/captcha_factory.php on line 83
  2. Strict Standards: call_user_func() expects parameter 1 to be a valid callback, non-static method phpbb_recaptcha::get_name() should not be called statically in /home/root/site/forum/includes/captcha/captcha_factory.php on line 89
  3. Fatal error: Cannot redeclare class phpbb_captcha_gd in /home/root/site/forum/includes/captcha/plugins/old_phpbb_captcha_gd_plugin.php on line 163


It states that phpbb_recaptcha::is_available() should not be called statically while I have just put it static according to your hint, I feel like running in circles :mrgreen:
  • joebert
  • Sledgehammer
  • Genius
  • No Avatar
  • Joined: Feb 10, 2004
  • Posts: 13455
  • Loc: Florida
  • Status: Offline

Post July 28th, 2012, 6:38 am

Lomic, it looks like you copied the PHP file as a backup and left it in the same directory. "old_phpbb_captcha_gd_plugin.php" I suspect phpBB is scanning that directory and loading any PHP files it finds. Either rename your backup to "old_phpbb_captcha_gd_plugin.php.bak" or move it out of that directory for the time being.
Strong with this one, the sudo is.
  • Lomic
  • Newbie
  • Newbie
  • No Avatar
  • Joined: Jul 18, 2012
  • Posts: 5
  • Status: Offline

Post July 28th, 2012, 10:24 am

Oh... you're right, I didn't noticed the error involving old_...

I have removed them now, the error is different after:
Code: [ Select ]
Strict Standards: call_user_func() expects parameter 1 to be a valid callback, non-static method phpbb_recaptcha::is_available() should not be called statically in /home/root/site/forum/includes/captcha/captcha_factory.php on line 83

Strict Standards: call_user_func() expects parameter 1 to be a valid callback, non-static method phpbb_recaptcha::get_name() should not be called statically in /home/root/site/forum/includes/captcha/captcha_factory.php on line 89

Strict Standards: call_user_func() expects parameter 1 to be a valid callback, non-static method phpbb_captcha_gd_wave::is_available() should not be called statically in /home/root/site/forum/includes/captcha/captcha_factory.php on line 83

Strict Standards: call_user_func() expects parameter 1 to be a valid callback, non-static method phpbb_captcha_gd_wave::get_name() should not be called statically in /home/root/site/forum/includes/captcha/captcha_factory.php on line 85

Strict Standards: call_user_func() expects parameter 1 to be a valid callback, non-static method phpbb_captcha_nogd::is_available() should not be called statically in /home/root/site/forum/includes/captcha/captcha_factory.php on line 83

Strict Standards: call_user_func() expects parameter 1 to be a valid callback, non-static method phpbb_captcha_nogd::get_name() should not be called statically in /home/root/site/forum/includes/captcha/captcha_factory.php on line 85

Strict Standards: call_user_func() expects parameter 1 to be a valid callback, non-static method phpbb_captcha_qa::is_available() should not be called statically in /home/root/site/forum/includes/captcha/captcha_factory.php on line 83

Strict Standards: Non-static method phpbb_captcha_qa::is_installed() should not be called statically in /home/root/site/forum/includes/captcha/plugins/phpbb_captcha_qa_plugin.php on line 135

Strict Standards: call_user_func() expects parameter 1 to be a valid callback, non-static method phpbb_captcha_qa::get_name() should not be called statically in /home/root/site/forum/includes/captcha/captcha_factory.php on line 89
  1. Strict Standards: call_user_func() expects parameter 1 to be a valid callback, non-static method phpbb_recaptcha::is_available() should not be called statically in /home/root/site/forum/includes/captcha/captcha_factory.php on line 83
  2. Strict Standards: call_user_func() expects parameter 1 to be a valid callback, non-static method phpbb_recaptcha::get_name() should not be called statically in /home/root/site/forum/includes/captcha/captcha_factory.php on line 89
  3. Strict Standards: call_user_func() expects parameter 1 to be a valid callback, non-static method phpbb_captcha_gd_wave::is_available() should not be called statically in /home/root/site/forum/includes/captcha/captcha_factory.php on line 83
  4. Strict Standards: call_user_func() expects parameter 1 to be a valid callback, non-static method phpbb_captcha_gd_wave::get_name() should not be called statically in /home/root/site/forum/includes/captcha/captcha_factory.php on line 85
  5. Strict Standards: call_user_func() expects parameter 1 to be a valid callback, non-static method phpbb_captcha_nogd::is_available() should not be called statically in /home/root/site/forum/includes/captcha/captcha_factory.php on line 83
  6. Strict Standards: call_user_func() expects parameter 1 to be a valid callback, non-static method phpbb_captcha_nogd::get_name() should not be called statically in /home/root/site/forum/includes/captcha/captcha_factory.php on line 85
  7. Strict Standards: call_user_func() expects parameter 1 to be a valid callback, non-static method phpbb_captcha_qa::is_available() should not be called statically in /home/root/site/forum/includes/captcha/captcha_factory.php on line 83
  8. Strict Standards: Non-static method phpbb_captcha_qa::is_installed() should not be called statically in /home/root/site/forum/includes/captcha/plugins/phpbb_captcha_qa_plugin.php on line 135
  9. Strict Standards: call_user_func() expects parameter 1 to be a valid callback, non-static method phpbb_captcha_qa::get_name() should not be called statically in /home/root/site/forum/includes/captcha/captcha_factory.php on line 89
again methods that should not be called statically while I put them static on purpose...
  • joebert
  • Sledgehammer
  • Genius
  • No Avatar
  • Joined: Feb 10, 2004
  • Posts: 13455
  • Loc: Florida
  • Status: Offline

Post July 28th, 2012, 10:30 am

Did you go through the file and add "static" in front of all of the method definitions, instead of only marking the ones mentioned in error messages? If you did, remove the keyword from the definitions mentioned in your new error messages.

Only mark methods static if they're mentioned in one of those "non-static method called statically" errors.
Strong with this one, the sudo is.
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post July 28th, 2012, 10:30 am

Post Information

  • Total Posts in this topic: 17 posts
  • Users browsing this forum: No registered users and 218 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.