Bunch of Inspekt errors/warnings Bunch of Inspekt errors/warnings
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Bunch of Inspekt errors/warnings

Started by Rookie, January 10, 2011, 06:00:41 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Rookie

Fresh install, latest version and I see a bunch of errors such as:

Strict Standards: Non-static method Inspekt::makeSuperCage() should not be called statically in ...\include\init.inc.php on line 50

It is quite annoying and I do not want to change warning setups.  Any idea... running latest PHP.

Thanks.

Rookie.

Αndré

Try to replace
$superCage = Inspekt::makeSuperCage($strict);
with
$inspekt = new Inspekt();
$superCage = $inspekt->makeSuperCage($strict);

in include/init.inc.php.


Moving to misc board.

marcou007

Hi Rookie,

did you try the solution proposed by André?

Did it work?

I am getting the same problem. I have install easyphp 5.3.5.0 and then unzip coppermine cpg1.5.12 to the "www" folder. Then, when I run coppermine from then "Local Web", I get the same error,

Strict standards: Non-static method Inspekt::makeSuperCage() should not be called statically

first says @ init.inc.php on line 50,
then says @ install.php on line 94,

Any clue what this could be?

thx,
Marc

marcou007

here are screenshots of the errors I mention bellow

marcou007

André, I have made your code change to file init.inc.php...

I think it worked since I got over the first error, however, it create an other error, same non-static, except this time in says at file inspekt.php @ line 284. then the second error appears (install.php) then the screen freeze and goes blue, then nothing?

any more instruction, ideas?

attached is screenshot
thx,
Marc

Αndré

Either you change all lines that generates errors as already suggested, or you google how you can disable strict error messages.

marcou007

Hi André,

I cannot change all lines that generate errors, I am newbie and do not understand what this code is for or what to replace it with... I am hopping there is a simpler solution.  But, is this a bug from coppermine cpg1.5.12 code or from my PC or some wrong settings? I believe users should have to alter the code of a program to have it work? So I assum some wrong settings on PC, no? I prefer change settings that alter the code of coppermine...If I must change some code, please guide me what changes to bring to the code.

I am running Coppermine locally on my PC with easyphp 5.3.5.0 under Windows XP, I am not running from remote server. I did not upload via ftp site, but copied to "www" folder of easyphp. Perhaps some parameter or some settings are wrong?

About the errors messages,
I googled how to disable strict error messages;
http://www.windowsnetworking.com/articles_tutorials/Disable-Error-Reporting-Windows-XP-Server-2003.html

If I do as instructed above, will coppermine then completely install properly, because it seamed to bug with these errors?
I mean if these errors are critical, not showing the errors will not solve them, I believe?

I will try tonight and let you know if it disabling the erros message solved the problem,
thx,
Marc

Αndré

Have a look at your php.ini file. There you'll find an entry
error_reporting  = 

According to the PHP documentation
Quote from: http://www.php.net/manual/en/function.error-reporting.phpVersion    Description
5.0.0    E_STRICT introduced (not part of E_ALL).
it should work if you use the following setting in your php.ini file:
Quoteerror_reporting  =  E_ALL & ~E_NOTICE
(that's how it's set in my testbed).

marcou007

André,

ok, I will try your suggestion and let you know if it works ok.

By muting error messaging, if it resolves the problem, will it affect the Coppermine functionality?

Marc

Αndré

I don't think so, but I haven't tested it. You'll see it very fast, as we use the Inspekt library all over the Coppermine code. If you can create categories, albums and upload images, everything is fine.

marcou007

André,

As you suggested, I have changed the php.ini files, I found a php.ini file in folder apache and a other php.ini file in folder conf_files . Both files had this code:

error_reporting = E_ALL | E_STRICT

I replaced it with this code:

error_reporting  =  E_ALL & ~E_NOTICE

And not on did the error disapear, but Coppermine finally installed completly! I do not know if it is fully functional yet, but so far, all looks good!! :-)

Thank you so much for you help, I am glade I finally got coppermine on my server! Now I will try it out for the first time.

Marc
ps: you can change the staus of this Topic as SOLVED

Αndré

Quote from: Joachim Müller on September 28, 2008, 12:46:26 PM
Resolve your threads
you can tag your answer as "solved" by clicking on the little image in your initial posting on your thread.

Alungatu

Sorry for reopen this topic, but I get same errors too.

QuoteStrict Standards: Non-static method Inspekt_Supercage::Factory() should not be called statically, assuming $this from incompatible context in /home/soferii/public_html/foto/include/inspekt.php on line 282

Strict Standards: Non-static method Inspekt::makeGetCage() should not be called statically, assuming $this from incompatible context in /home/soferii/public_html/foto/include/inspekt/supercage.php on line 124

Strict Standards: Non-static method Inspekt_Cage::Factory() should not be called statically, assuming $this from incompatible context in /home/soferii/public_html/foto/include/inspekt.php on line 147

Strict Standards: Non-static method Inspekt::makePostCage() should not be called statically, assuming $this from incompatible context in /home/soferii/public_html/foto/include/inspekt/supercage.php on line 125

Strict Standards: Non-static method Inspekt_Cage::Factory() should not be called statically, assuming $this from incompatible context in /home/soferii/public_html/foto/include/inspekt.php on line 170

Strict Standards: Non-static method Inspekt::makeCookieCage() should not be called statically, assuming $this from incompatible context in /home/soferii/public_html/foto/include/inspekt/supercage.php on line 126

Strict Standards: Non-static method Inspekt_Cage::Factory() should not be called statically, assuming $this from incompatible context in /home/soferii/public_html/foto/include/inspekt.php on line 192

Strict Standards: Non-static method Inspekt::makeEnvCage() should not be called statically, assuming $this from incompatible context in /home/soferii/public_html/foto/include/inspekt/supercage.php on line 127

Strict Standards: Non-static method Inspekt_Cage::Factory() should not be called statically, assuming $this from incompatible context in /home/soferii/public_html/foto/include/inspekt.php on line 215

Strict Standards: Non-static method Inspekt::makeFilesCage() should not be called statically, assuming $this from incompatible context in /home/soferii/public_html/foto/include/inspekt/supercage.php on line 128

Strict Standards: Non-static method Inspekt_Cage::Factory() should not be called statically, assuming $this from incompatible context in /home/soferii/public_html/foto/include/inspekt.php on line 238

Strict Standards: Non-static method Inspekt::makeServerCage() should not be called statically, assuming $this from incompatible context in /home/soferii/public_html/foto/include/inspekt/supercage.php on line 134

Strict Standards: Non-static method Inspekt_Cage::Factory() should not be called statically, assuming $this from incompatible context in /home/soferii/public_html/foto/include/inspekt.php on line 124

I verified php.ini configuration from WebHost Manager, and error_reporting is E_ALL & ~E_NOTICE & ~E_DEPRECATED. Still not working... what to do?

PS: Sorry for my english..


Alungatu


cobraspaz

Terrible response from the Devs by the way. When the code has errors, telling someone to turn off the error messages is NOT a fix.

When someone responds that they can't modify php.ini because they are on a shared web host, telling them to get a new web host is NOT a fix.

Rewritting the code to follow the "Strict Standards" that would work. Or even explaining how to interpret the error messages so the end user can fix it, that works as well.  So in the case someone else has this same error, I will explain an easy way to fix it and have your gallery working again.

On each line it says something like:
Non-static method Inspekt::makeSuperCage() should not be called statically in ...

Don't worry about the line after in, because it IS in fact a static method but PHP doesn't think it is. Therefore you have to find the function itself and declare it as a function.

The part of the line that says Inspekt::makeSuperCage() this is calling the function makeSuperCage() in the class Inspekt. The word before the :: is referring to the class and the word after the :: is the function within that class. So how do we fix it?

First we locate the class Inspekt which happens to be conveniently located in the file Inspekt.php.
Next we locate the following line:
function makeSuperCage()

and add public static before it like so:
public static function makeSuperCage()

Do this for every item that you have an error for. Then everything will work. I fixed my copper-mine gallery this way after I saw that the response from the Devs was useless.

The only downside to this is that the next time you upgrade you will have to re-fix your code because it seems obvious the devs don't care and they aren't planning on fixing it. They just want you to turn off Strict Standards or pick a different web host.

phill104

#16
Excuse me but we do care. These are "WARNINGS", not "ERRORS" as has been stated many times above. They are for developers information and should not be displayed on a live website. I cannot think of a decent host where you cannot turn off those WARNINGS either via php.ini, .htaccess or even via the cPanel in some cases.

It IS being addressed and code IS being worked on. Please remember that we are a very small team doing this for FREE in our spare time. You are enjoying the fruits of that FREE package and our valuable time spent giving you it. So please do not come on telling us we do not care, we certainly do or we would not have given up thousands of hours developing and supporting Coppermine.

I would like however to thank you for your detailed explanation of how users can adjust the code although there are almost certainly better methods which are part of a big code overhaul. We are slowly working on CPG 1.6 which will be fully up to date PHP version wise.
It is a mistake to think you can solve any major problems just with potatoes.

cobraspaz

I will apologize for saying that the devs don't care. I was just aggravated that it seemed the first response was to turn off the warnings, and in another thread the user was told to get a different web host. I feel like sometimes the devs on here could use a little bit of tact when responding to people who need help.

That made me upset enough that I had to post a reply. The problem with the strict warnings is that when they are turned on, not only do they jumble up the page with nonsense, they also stop the code from running properly. The other problem is knowing where in the cPanel to adjust the php settings and turn them off.

Hopefully my post will help anyone in the future who can't or doesn't know how to turn off the warnings. The quick and dirty fix that I posted will work until version 1.6.

and since I use and do like coppermine gallery. Thanks for your support.

VLK

Hi,

I have made public static change to a inspekt.php file and some warnings removed. But still there is the following warnings, how can I remove them?


Strict Standards: Non-static method Inspekt_Supercage::Factory() should not be called statically in /home/mtjart/public_html/kuvagalleria/include/inspekt.php on line 283

Strict Standards: Non-static method Inspekt_Cage::Factory() should not be called statically in /home/mtjart/public_html/kuvagalleria/include/inspekt.php on line 147

Strict Standards: Non-static method Inspekt_Cage::Factory() should not be called statically in /home/mtjart/public_html/kuvagalleria/include/inspekt.php on line 170

Strict Standards: Non-static method Inspekt_Cage::Factory() should not be called statically in /home/mtjart/public_html/kuvagalleria/include/inspekt.php on line 192

Strict Standards: Non-static method Inspekt_Cage::Factory() should not be called statically in /home/mtjart/public_html/kuvagalleria/include/inspekt.php on line 215

Strict Standards: Non-static method Inspekt_Cage::Factory() should not be called statically in /home/mtjart/public_html/kuvagalleria/include/inspekt.php on line 238

Strict Standards: Non-static method Inspekt_Cage::Factory() should not be called statically in /home/mtjart/public_html/kuvagalleria/include/inspekt.php on line 124


Αndré