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.
Scam Warning

Problems installing "Non-static method"

Postby nanio » Mon Jun 22, 2009 3:50 am

Hello! I'm trying to set up a home small server of phpBB, the main use of this server will be for me and my friend to learn how to use phpBB and maybe build a forum there.

But I encounter a problem after the "Administrator configuration", it says the following:
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 have tried to search the forums but I have found no working sollution for the problem. I tried to install phpBB using AppServ and following this guid: http://www.ocforums.com/showthread.php?t=272080 ..only I slightlhly modified it to fit with PHPbb 3.

Thank you very much for all replies! ^^
nanio
Registered User
 
Posts: 2
Joined: Mon Jun 22, 2009 3:44 am

Re: Problems installing "Non-static method"

Postby Paul » Mon Jun 22, 2009 9:34 am

Best you can do is disable the strict standard errors i n php.ini by changing the error level.
Knock knock
Race condition
Who's there?
User avatar
Paul
MOD Team Member
MOD Team Member
 
Posts: 17537
Joined: Sat Dec 04, 2004 3:44 pm
Location: The netherlands.
Name: Paul Sohier

Re: Problems installing "Non-static method"

Postby nanio » Mon Jun 22, 2009 3:10 pm

I really do feel like a bother saying this, but I can't find a "php.ini" file, how ever the problem was resolved (made worse) after giving PHPbb all rights under phpMyAdmin, now I get the following errors:
Code: Select all
Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in C:\AppServ\www[l\phpBB3\includes\utf\utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /install/index.php on line 440: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /install/index.php on line 441: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /install/index.php on line 442: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /install/index.php on line 443: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)


I have sett phpBB3 to have "all rights" in my user in FileZilla + it has all rights under phpMyAdmin. If I try to press forward with the install I get "a critical error"

*EDIT*
If I turn off FileZilla (I never really saw the use of FileZilla as I thought Apache could "host" it) I only get the good old:
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
nanio
Registered User
 
Posts: 2
Joined: Mon Jun 22, 2009 3:44 am

Re: Problems installing "Non-static method"

Postby SuperFedya » Fri Feb 11, 2011 1:40 am

Same problem with Drupal and phpbb3 integration module:
http://drupal.org/node/918884
SuperFedya
Registered User
 
Posts: 222
Joined: Sun Jul 14, 2002 9:14 pm

Re: Problems installing "Non-static method"

Postby xflr6 » Sat Mar 31, 2012 3:30 pm

I simply can't believe what i am reading here... No offense to anyone, but if here the best thing you can do is to turn off notices, you might as well unplug your comp, get some fresh air and go to the library borrow a book about php... I justify :

What we have here is :
-> phpbb is a 'php' written program
-> php notices exist not to make your hmtl rendering look ugly, but only to inform you about something that outta be fixed if you wanna do your job normally and so that all your phpbb functionalities will be ensured and working in a stable way. Notices are not errors, i am not taking about errors here or fatal errors whatever.

So, now that we now that php is trying to tell us that something's wrong, what does it say?

-it simply tells us, that in \includes\utf\utf_tools.php at line 1781 the function called nfc() is not being called the right way..... and depending on the function, you might lack on features or stability, so that, you can trust people telling you to turn notices, your choice, but after that, don't be surprised if it blows to your face, especially when you're forum is alreay in production....

-utf_normalizer::nfc() tells us that nfc() is a function from the utf-normalizer Class, and that the programmer thought he would be able to access that function without instantiating the aforementioned class....

-So, to fix that we have to to access this nfc() method thru an instantiation of the utf-normalizer class, instead of accessing the class statically using the :: syntax...
-so we instatiate the class by adding the following
Code: Select all
$utfn = new utf_normalizer();

-and now we only have to call our function using the following
Code: Select all
$utfn->nfc($strings);


[To make it easy for non-programmers] :
Go to \includes\utf\utf_tools.php at line 1766 (because we don't want to forget brackets or parenthesis on the way and because the modification is not needed only once), we're gonna replace the whole utf8_normalize_nfc() function by the following fix

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->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->nfc($strings[$key]);}
      }
   }

   return $strings;
}


No need to restart your webserver or retransfering your files switching from default to binary :)
Of course some php version won't see owl for that, but, that's what i got trying to run the installaton of the latest v3.0.10 phpbb code with php 5.4.0.

Hope it saves times and frustration.
xflr6
Registered User
 
Posts: 2
Joined: Sat Mar 31, 2012 2:22 pm

Re: Problems installing "Non-static method"

Postby xflr6 » Sat Mar 31, 2012 3:44 pm

also, same situation at around line 1664 or this utf_tools files, ajust according to my last post an it should work :)
xflr6
Registered User
 
Posts: 2
Joined: Sat Mar 31, 2012 2:22 pm

Re: Problems installing "Non-static method"

Postby naderman » Sat Mar 31, 2012 4:49 pm

The function really is static and is supposed to be called statically. The problem is that phpBB3.0 still supports PHP4 so we cannot use the static keyword for the function. This will be fixed in 3.1, but in 3.0 we cannot support PHP4 while having STRICT errors enabled.
Need Help? Professional phpBB maintenance services are available at Forumatic.
I appreciate gifts from my Amazon wishlist.
naderman.de twitter: @naderman
User avatar
naderman
Development Team Leader
Development Team Leader
 
Posts: 3475
Joined: Fri Aug 01, 2003 10:06 pm
Location: Berlin, Germany
Name: Nils Adermann

Re: Problems installing "Non-static method"

Postby Oleg » Sun Apr 01, 2012 12:38 pm

See http://tracker.phpbb.com/browse/PHPBB3-10615.

For 3.0.x we must support php 4 which does not have a static keyword at all. Apply https://github.com/phpbb/phpbb3/pull/626.

For 3.1 we drop php 4 support and change the code to call static functions statically.
Oleg
Former Team Member
 
Posts: 1221
Joined: Sat Jan 30, 2010 4:42 pm
Location: NYC

Re: Problems installing "Non-static method"

Postby superj707 » Thu Jun 07, 2012 9:44 pm

superj707
Registered User
 
Posts: 1136
Joined: Thu Feb 26, 2009 12:20 am

Re: Problems installing "Non-static method"

Postby okguy » Tue Jul 10, 2012 8:26 pm

I use PHP 5.4.3 and the trick given by xflr6 does not work on line 1664.

I had the line 1660 :
$utfn = new utf_normalizer();
And I just replace :
$utf_normalizer::nfkc($text);
by :
$utfn->nfkc($text);

What is missing ?

Thanks, Rgds,
OkGuy
okguy
Registered User
 
Posts: 2
Joined: Tue Jul 10, 2012 8:21 pm

Re: Problems installing "Non-static method"

Postby Noxwizard » Tue Jul 10, 2012 9:12 pm

You should not be using what xflr6 posted, as it is not correct. You should use the code from Github that Oleg linked to or the quick change in the topic that superj707 linked to.
[Support Template] - [Read Before Posting] - [phpBB Knowledge Base]
Hosting Services - The Business Helpdesk.com, Inc.
Do not contact me for private support, please share the question in our forums.
User avatar
Noxwizard
Support Team Leader
Support Team Leader
 
Posts: 9538
Joined: Mon Jun 27, 2005 8:41 pm
Location: Texas, USA
Name: Patrick Webster

Re: Problems installing "Non-static method"

Postby okguy » Wed Jul 11, 2012 6:24 am

Thank you it solves the problem. The trick from the mentioned links is :
Add & ~E_STRICT to the error_reporting() line (~22) in /includes/startup.php
okguy
Registered User
 
Posts: 2
Joined: Tue Jul 10, 2012 8:21 pm

Re: Problems installing "Non-static method"

Postby jackman0 » Sun Jul 15, 2012 10:47 pm

naderman wrote:The function really is static and is supposed to be called statically. The problem is that phpBB3.0 still supports PHP4 so we cannot use the static keyword for the function. This will be fixed in 3.1, but in 3.0 we cannot support PHP4 while having STRICT errors enabled.


xflr6 wrote:I simply can't believe what i am reading here... No offense to anyone, but if here the best thing you can do is to turn off notices, you might as well unplug your comp, get some fresh air and go to the library borrow a book about php... I justify :

What we have here is :
-> phpbb is a 'php' written program
-> php notices exist not to make your hmtl rendering look ugly, but only to inform you about something that outta be fixed if you wanna do your job normally and so that all your phpbb functionalities will be ensured and working in a stable way. Notices are not errors, i am not taking about errors here or fatal errors whatever.


Why aren't we branching phpBB3 for different versions of PHP? This seems like a logical thing to do and something I've seen in a LOT of other software projects.
jackman0
Registered User
 
Posts: 1
Joined: Sun Jul 15, 2012 10:42 pm

Re: Problems installing "Non-static method"

Postby Oleg » Mon Jul 16, 2012 6:38 pm

Because it is easier to make the one line change mentioned. If you don't want to use the one line workaround you can apply the full fix as already stated.
Oleg
Former Team Member
 
Posts: 1221
Joined: Sat Jan 30, 2010 4:42 pm
Location: NYC


Return to 3.0.x Support Forum

Who is online

Users browsing this forum: Bing [Bot], Google [Bot], MSNbot Media and 64 guests