Installing phpBB3 on PHP 5.4.0

  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13504
  • Loc: Florida

Post 3+ Months Ago

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)
  • Bigwebmaster
  • Site Admin
  • Site Admin
  • User avatar
  • Posts: 9102
  • Loc: Seattle, WA & Phoenix, AZ

Post 3+ Months Ago

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.
  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13504
  • Loc: Florida

Post 3+ Months Ago

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.
  • Lomic
  • Newbie
  • Newbie
  • Lomic
  • Posts: 5

Post 3+ Months Ago

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
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13504
  • Loc: Florida

Post 3+ Months Ago

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.
  • Lomic
  • Newbie
  • Newbie
  • Lomic
  • Posts: 5

Post 3+ Months Ago

Thanks joebert! I will try on my board asap!
  • Zealous
  • Guru
  • Guru
  • User avatar
  • Posts: 1244
  • Loc: Sydney

Post 3+ Months Ago

would it not be better just to run it on a Linux environment, should be straight forward then.
  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13504
  • Loc: Florida

Post 3+ Months Ago

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.
  • xoxoxoxox
  • Born
  • Born
  • xoxoxoxox
  • Posts: 2

Post 3+ Months Ago

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
  • xoxoxoxox
  • Posts: 2

Post 3+ Months Ago

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
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13504
  • Loc: Florida

Post 3+ Months Ago

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.
  • Lomic
  • Newbie
  • Newbie
  • Lomic
  • Posts: 5

Post 3+ Months Ago

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
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13504
  • Loc: Florida

Post 3+ Months Ago

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.
  • Lomic
  • Newbie
  • Newbie
  • Lomic
  • Posts: 5

Post 3+ Months Ago

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
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13504
  • Loc: Florida

Post 3+ Months Ago

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.
  • Lomic
  • Newbie
  • Newbie
  • Lomic
  • Posts: 5

Post 3+ Months Ago

I only marked the ones you mentionned... but maybe I did not start from original files... I need to check that :-/

[Edit]I uploaded brad new captcha_factory and the other one, then applied the "public static" where you told me, and this is what I get:
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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/site/forum/includes/captcha/captcha_factory.php on line 89

I will look closely after dinner ;) thanks for your help :)
  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13504
  • Loc: Florida

Post 3+ Months Ago

Listen to the error messages, not to me. :)

Post Information

  • Total Posts in this topic: 17 posts
  • Users browsing this forum: No registered users and 60 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
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.