Problems installing "Non-static method"

Get help with installation and running phpBB 3.0.x here. Please do not post bug reports, feature requests, or MOD-related questions here.
Suggested Hosts
Forum rules
END OF SUPPORT: 1 January 2017 (announcement)
User avatar
KevC
Support Team Member
Support Team Member
Posts: 70280
Joined: Fri Jun 04, 2004 10:44 am
Location: Oxford, UK
Contact:

Re: Problems installing "Non-static method"

Post by KevC »

Kemaleon wrote:I have previously installed phpbb 3.0.12 (latest) on Xampp foolishly thinking I could just restore a backup from the current board, obviously that didn't work!
Yes you can.
You just need to run the install/database_update.php script to update the database to 3.0.12 as well.
-:|:- Support Request Template -:|:-
Image
Cheap UK Hosting
"In the land of the blind the little green bloke with no pupils is king - init!"
User avatar
Kemaleon
Registered User
Posts: 3
Joined: Fri Jan 31, 2014 9:55 pm

Re: Problems installing "Non-static method"

Post by Kemaleon »

Really? Could I possibly ask for a little step-by-step for this please? And thank you for your response.

Related: tried following the steps in This Guide to restore using BigDump but I'm getting duplicate files errors. Have installed the support toolkit but a bit scared to run it. Obviously I have (and will again) backed things up but I need to know I can restore first or its all pointless.

Fun and headache in equal measure!
User avatar
Oyabun1
Former Team Member
Posts: 23162
Joined: Sun May 17, 2009 1:05 pm
Location: Australia
Name: Bill

Re: Problems installing "Non-static method"

Post by Oyabun1 »

The database doesn't store files therefore duplicate file errors seem unlikely. What is the exact error message you are getting and what are you doing when the error arises? How big is the database?
                      Support Request Template
3.0.x: Knowledge Base Styles Support MOD Requests
3.1.x: Knowledge BaseStyles SupportExtension Requests
User avatar
Kemaleon
Registered User
Posts: 3
Joined: Fri Jan 31, 2014 9:55 pm

Re: Problems installing "Non-static method"

Post by Kemaleon »

I'll have to get back to you with a proper answer later as I'm unable to play with it again right now, but:

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

(I copied this from the OP's post but mine is the same except for the beginning path as mine is named differently, but you get the idea)

I backed up my database via MyPhpAdmin and tried to restore via Bigdump following the phpbb.com guide I posted in my first post. Database is showing 289M which seems excessive as it's only a small forum with around 30-40 members, some regular posters some occasional.

Hopefully get time to try again tonight and will post any other relevant information, need to update the board to the latest phpbb but if I can't even restore onto the same version (phpbb 3.0.9) it makes me a little apprehensive!

Thanks for any further help.
User avatar
Oyabun1
Former Team Member
Posts: 23162
Joined: Sun May 17, 2009 1:05 pm
Location: Australia
Name: Bill

Re: Problems installing "Non-static method"

Post by Oyabun1 »

Kemaleon wrote: but I'm getting duplicate files errors.
Kemaleon wrote:Error message:
Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in C:\AppServ\www\phpBB3\includes\utf\utf_tools.php on line 1781

(I copied this from the OP's post but mine is the same except for the beginning path as mine is named differently, but you get the idea)
Not really. I can't see where there is any mention of duplicate files in that error message?
                      Support Request Template
3.0.x: Knowledge Base Styles Support MOD Requests
3.1.x: Knowledge BaseStyles SupportExtension Requests
nl2dav
Registered User
Posts: 105
Joined: Tue Jun 25, 2002 10:39 pm
Location: NOP, The Netherlands
Contact:

Re: Problems installing "Non-static method"

Post by nl2dav »

Because xlfr6 is on the right path but overlooked something.

This should be the function;

Code: Select all

function utf8_normalize_nfc($strings){
   
   if (empty($strings)){return $strings;}

   if (!class_exists('utf_normalizer')){
      global $phpbb_root_path, $phpEx;
      include($phpbb_root_path . 'includes/utf/utf_normalizer.' . $phpEx);
      $utfn = new utf_normalizer();
   }

   if (!is_array($strings)){$utfn = new utf_normalizer(); $utfn->nfc($strings);}
   
   else if (is_array($strings)){
      foreach ($strings as $key => $string){
         if (is_array($string)){foreach ($string as $_key => $_string){$utfn->nfc($strings[$key][$_key]);}}
         else{$utfn = new utf_normalizer(); $utfn->nfc($strings[$key]);}
      }
   }

   return $strings;
}
Just switching error messages to off isn't really the solution.
User avatar
Lumpy Burgertushie
Registered User
Posts: 68307
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: Problems installing "Non-static method"

Post by Lumpy Burgertushie »

are you aware that the post you are replying to is 4 years old?
:D

I know, I do the same thing some times.


robert
I'm baaaaaccckkkk. still doing work on donation basis. PM your needs.

Premium phpBB 3.3 Styles by PlanetStyles.net

If nobody is in the forest, does a tree really fall?
nl2dav
Registered User
Posts: 105
Joined: Tue Jun 25, 2002 10:39 pm
Location: NOP, The Netherlands
Contact:

Re: Problems installing "Non-static method"

Post by nl2dav »

Yes I am aware of that. I searched for a proper solution but couldn't find it. Maybe there is someone still dealing with the same issues. I don't want to make the 3.0->3.1 phpBB move and I don't want to switch off E_STRICT errors @ PHP5.4 and up ;) .. Which is the "official" solution (phpBB devs say they can't drop PHP4 support although it's stone age now so they have to do it like this)

By the way, the last post in this topic was from August last year so it is not thát old.
User avatar
Noxwizard
Support Team Leader
Support Team Leader
Posts: 10416
Joined: Mon Jun 27, 2005 8:41 pm
Location: Texas, USA
Name: Patrick Webster
Contact:

Re: Problems installing "Non-static method"

Post by Noxwizard »

The actual solution is more simplistic. Those methods simply need to be made static. The class has no members, so there's no need to instantiate it. That's why every time someone posts a "solution", we tell you not to use it. phpBB 3.0.x officially still supports PHP 4, so we cannot make those functions static, but we were able to in 3.1.x.

The correct fix:
Open: /includes/utf/utf_normalizer.php
Find: (lines 80, 122, 154, 186, 212, 245, 947)

Code: Select all

function
Replace with:

Code: Select all

static function
However, if you are receiving these warnings, it is a sign that your installation is either out-of-date or has not been properly updated.
[Support Template] - [Read Before Posting] - [phpBB Knowledge Base]
Do not contact me for private support, please share the question in our forums.
nl2dav
Registered User
Posts: 105
Joined: Tue Jun 25, 2002 10:39 pm
Location: NOP, The Netherlands
Contact:

Re: Problems installing "Non-static method"

Post by nl2dav »

Right, thanks for this enlightenment (although I came across this problem with some other MOD yesterday as well and used your solution there).

It's true, our installation isn't properly patched but that isn't for years already because it's too heavily customized (including the DB). I "handpicked" some security updates and other tweaks, manually modified code the last years. Sure, not recommended and not for everybody because it can lead to (security) mistakes.. But.. Ah well.. Like to learn anyway. Maybe there is someone else which does it in the same way and comes across these problems when moving from 5.3 to 5.4 or up. It's nice to understand whats going on instead of simply switching off error messaging, I think.

I guess there is a final 100% answer now 8-)
wtfbollos
Registered User
Posts: 15
Joined: Fri Sep 18, 2015 12:46 am

Re: Problems installing "Non-static method"

Post by wtfbollos »

Noxwizard wrote:The actual solution is more simplistic. Those methods simply need to be made static. The class has no members, so there's no need to instantiate it. That's why every time someone posts a "solution", we tell you not to use it. phpBB 3.0.x officially still supports PHP 4, so we cannot make those functions static, but we were able to in 3.1.x.

The correct fix:
Open: /includes/utf/utf_normalizer.php
Find: (lines 80, 122, 154, 186, 212, 245, 947)

Code: Select all

function
Replace with:

Code: Select all

static function
[/b][/color]

However, if you are receiving these warnings, it is a sign that your installation is either out-of-date or has not been properly updated.
thank you Noxwizard!
Locked

Return to “[3.0.x] Support Forum”