forum.coppermine-gallery.net

Support => cpg1.5.x Support => cpg1.5 miscellaneous => Topic started by: Rookie on January 10, 2011, 06:00:41 am

Title: Bunch of Inspekt errors/warnings
Post by: Rookie on January 10, 2011, 06:00:41 am
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.
Title: Re: Bunch of Inspekt errors/warnings
Post by: Αndré on January 18, 2011, 10:48:52 am
Try to replace
Code: [Select]
$superCage = Inspekt::makeSuperCage($strict);with
Code: [Select]
$inspekt = new Inspekt();
$superCage = $inspekt->makeSuperCage($strict);
in include/init.inc.php.


Moving to misc board.
Title: Re: Bunch of Inspekt errors/warnings
Post by: marcou007 on January 27, 2011, 03:40:58 am
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
Title: Re: Bunch of Inspekt errors/warnings
Post by: marcou007 on January 27, 2011, 03:50:49 am
here are screenshots of the errors I mention bellow
Title: Re: Bunch of Inspekt errors/warnings
Post by: marcou007 on January 27, 2011, 04:17:59 am
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
Title: Re: Bunch of Inspekt errors/warnings
Post by: Αndré on January 27, 2011, 09:28:52 am
Either you change all lines that generates errors as already suggested, or you google how you can disable strict error messages.
Title: Re: Bunch of Inspekt errors/warnings
Post by: marcou007 on January 27, 2011, 02:31:25 pm
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
Title: Re: Bunch of Inspekt errors/warnings
Post by: Αndré on January 27, 2011, 02:53:50 pm
Have a look at your php.ini file. There you'll find an entry
Code: [Select]
error_reporting  = 
According to the PHP documentation
Quote from: http://www.php.net/manual/en/function.error-reporting.php
Version    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:
Quote
error_reporting  =  E_ALL & ~E_NOTICE
(that's how it's set in my testbed).
Title: Re: Bunch of Inspekt errors/warnings
Post by: marcou007 on January 27, 2011, 03:46:44 pm
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
Title: Re: Bunch of Inspekt errors/warnings
Post by: Αndré on January 27, 2011, 04:03:26 pm
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.
Title: Re: Bunch of Inspekt errors/warnings
Post by: marcou007 on January 28, 2011, 03:23:33 am
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
Title: Re: Bunch of Inspekt errors/warnings
Post by: Αndré on January 28, 2011, 09:23:43 am
Resolve your threads
you can tag your answer as "solved" by clicking on the little image in your initial posting on your thread.
Title: Re: Bunch of Inspekt errors/warnings
Post by: Alungatu on June 08, 2013, 01:03:41 pm
Sorry for reopen this topic, but I get same errors too.

Quote
Strict 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..
Title: Re: Bunch of Inspekt errors/warnings
Post by: Αndré on June 08, 2013, 08:41:31 pm
http://forum.coppermine-gallery.net/index.php/topic,75836.msg365730.html#msg365730
Title: Re: Bunch of Inspekt errors/warnings
Post by: Alungatu on June 08, 2013, 09:20:01 pm
Thanks! Worked.
Title: Re: Bunch of Inspekt errors/warnings
Post by: cobraspaz on August 07, 2013, 09:03:58 pm
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:
Code: [Select]
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:
Code: [Select]
function makeSuperCage()
and add public static before it like so:
Code: [Select]
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.
Title: Re: Bunch of Inspekt errors/warnings
Post by: phill104 on August 07, 2013, 09:54:48 pm
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.
Title: Re: Bunch of Inspekt errors/warnings
Post by: cobraspaz on August 07, 2013, 11:49:30 pm
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.
Title: Re: Bunch of Inspekt errors/warnings
Post by: VLK on September 27, 2013, 12:59:48 pm
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

Title: Re: Bunch of Inspekt errors/warnings
Post by: Αndré on September 27, 2013, 07:37:42 pm
Try to apply all of those changes: http://sourceforge.net/p/coppermine/code/8589/
Title: Re: Bunch of Inspekt errors/warnings
Post by: oexeliteo on November 05, 2013, 02:27:14 am
Hi andré,

Im also getting this Strict Standards: info on my gallery now, i have run this gallery for some time and been good, but for files to edit im lost.
do i copy paste the info from the link you post on the set file and re upload it ? or just have to edit some lines ?
Title: Re: Bunch of Inspekt errors/warnings
Post by: oexeliteo on November 05, 2013, 02:57:00 am
Have a look at your php.ini file. There you'll find an entry
Code: [Select]
error_reporting  = 
According to the PHP documentationit should work if you use the following setting in your php.ini file:(that's how it's set in my testbed).



Can you plz tell me what file is php.ini ? all i can find in my cpg15x folder is init.inc.php ? it also dont have error_reporting  = in it.
Title: Re: Bunch of Inspekt errors/warnings
Post by: Αndré on November 05, 2013, 09:27:07 am
The file php.ini is no part of Coppermine, but your PHP installation. See http://php.net/manual/en/configuration.file.php

It depends on your server setting if you're allowed to access or modify it. Please ask your hosting provider for support.
Title: Re: Bunch of Inspekt errors/warnings
Post by: jtintner on December 28, 2013, 04:16:17 pm
I seem to be having this issue as well.

The problem I'm having is that I'm also not even able to login to the my site.  Everytime I try to login with the admin creds it keeps saying "welcome guest" and then brings me right back to the page but I don't have access to any of the configurations.

http://usmilitarypatches.com/gallery/index.php?cat=2 (http://usmilitarypatches.com/gallery/index.php?cat=2) here is an example of what I've seen a lot of on these forums. 

So is the solution inside the PHP.ini file?  Since I'm unable to login via the website on the front end apparently and NO changes have been made whatsoever in the last month I'm not sure where this came from.

How have been combat this yet?  I can't seem to find a straight forward solution to this on the forums
Title: Re: Bunch of Inspekt errors/warnings
Post by: phill104 on January 30, 2014, 09:10:11 am
You appear to be running CPG version 1.5.20.  Please upgrade to the latest release as these problems have been fixed. I am guessing they have popped up because your host has changed something or upgraded php.