flooding of error messages in apache2 error log

43 views
Skip to first unread message

Heinrich Stoellinger

unread,
Feb 1, 2014, 1:38:06 PM2/1/14
to seagull...@googlegroups.com
Hello Demian,
Sorry to bother you, but...
Lately I keep getting a "flood" of the following messages in log
/var/log/apache2/rainermusik-error_log

PHP Strict Standards: Non-static method SGL_Config::singleton() should not be called
statically, assuming $this from incompatible context in
/home/rainermusik/seagull/lib/SGL/String.php on line 280

Any idea how I can fix it. It fills up my disk quickly...
Seagull is at version 0.6.8, PHP is at version 5.5.8
Thanks for ANY ideas.

--
Erstellt mit Operas revolutionärem E-Mail-Modul: http://www.opera.com/mail/

Heinrich Stoellinger

unread,
Feb 1, 2014, 2:13:07 PM2/1/14
to Turner Demian
Hello,
the message also occurs for methods
SGL_Session::getRoleId()
SGL::logMessage()
SGL_String::translate()
as far as I can see...
Regards
H

John Steele

unread,
Feb 1, 2014, 8:07:17 PM2/1/14
to seagull...@googlegroups.com
Hello Heinrich,

The best solution would be to remove the static keyword from in front of
those functions, but there are several ways of handling the errors.

As per the http://php.net/error_reporting manual page:

PHP 5.3 or later, the default value is E_ALL & ~E_NOTICE & ~E_STRICT &
~E_DEPRECATED. This setting does not show E_NOTICE, E_STRICT and
E_DEPRECATED level errors. You may want to show them during development.
Prior to PHP 5.3.0, the default value is E_ALL & ~E_NOTICE & ~E_STRICT. In
PHP 4 the default value is E_ALL & ~E_NOTICE.

Since you say your PHP version is 5.5.8 it looks like your php.ini file
is setting a custom level since E_STRICT should not be showing. So you can
either set this in code:

error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED);

or in php.ini:

error_reporting = E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED

Here's a great article for handling errors with .htaccess for production
vs development environments:

http://perishablepress.com/advanced-php-error-handling-via-htaccess/

Hope that helps,
John
>--
>You received this message because you are subscribed to the Google Groups
>"Seagull PHP Framework General Group" group.
>To unsubscribe from this group and stop receiving emails from it, send an
>email to seagull_gener...@googlegroups.com.
>To post to this group, send email to seagull...@googlegroups.com.
>Visit this group at http://groups.google.com/group/seagull_general.
>For more options, visit https://groups.google.com/groups/opt_out.

Heinrich Stoellinger

unread,
Feb 2, 2014, 5:47:47 AM2/2/14
to seagull...@googlegroups.com
Hello John,
Thanks for your prompt answer; I defined error_reporting in php.ini as
suggested by you, restarted apache2, even re-booted the system, but I STILL
keep getting the messages.
So - as you say - not calling these functions statically would of course be
the REAL solution.
However then wouldn't I have to call them on some object, correct? I am not
deep enough into Seagull to know all the "collaterals" and therefor how to
fix the problem. Since it will most likely affect more people, it would be
good to fix it anyhow. It might of course be that it is already fixed in a
later version...
Regards from Salzburg
Heinrich (Heinz!)

On Sun, 02 Feb 2014 02:07:17 +0100, John Steele <jaste...@gmail.com> wrote:

> error_reporting = E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED


Heinrich Stoellinger

unread,
Feb 2, 2014, 6:44:24 AM2/2/14
to seagull...@googlegroups.com
Hi again,
Looking at my php5info() I see that the value for error_reporting is in fact 22519
(i.e. E_ALL & ~E_DEPRECATED & ~E_STRICT). I have also found a bug
(Bug #61356 error_reporting always reports E_STRICT), reported already in March
2012 for PHP 5.4. Should of course have been fixed in 5.5, but then, bugs DO sometimes
reappear...
Regards
Heinz

Demian Turner

unread,
Feb 2, 2014, 4:05:39 PM2/2/14
to Seagull General
Hi Heinz

Apologies for the slow reply, am abroad working onsite with a customer. 0.6.8 is very old, can’t you try a more recent 1.x version of Seagull?

The thing is a lot of these errors were fixed. Sorry I can’t be more helpful.

Interesting you mention the php 5.4 bug, I wasn’t aware of that, just changed tons of code to work around it for an upcoming github release.

cheers Demian

Heinrich Stoellinger

unread,
Feb 8, 2014, 2:54:21 AM2/8/14
to seagull...@googlegroups.com
Hi Demian,
I am trying to install SG 1.0.5 as per your suggestion. Finding a note that the publisher
module is deprecated I wonder how to proceed. Up to now I have only been using
static HTML articles which I defined to SG using the publisher. Any ideas on how to
proceed with not TOO much effort involved in the conversion from 0.6.8 to 1.0.5?
Regards
Heinrich

Demian Turner

unread,
Feb 8, 2014, 6:02:32 AM2/8/14
to Seagull General
Hi Heinrich

It’s a popular question but I’m afraid I don’t know the answer. Publisher has a lot of the oldest/poorest code in it so a rewrite was seen as the only option. I guess other people created their own CMSs, I have one but don’t have time right now to ensure it’s working smoothly for 1.x.

Again, sorry I can’t be more help.

cheers Demian

host...@gmail.com

unread,
Dec 3, 2014, 3:40:00 AM12/3/14
to seagull...@googlegroups.com, hc.stoe...@aon.at
Hi, I need you help in adding multiple DB host in my App.  I have 2 DB host. which some modules will DBHOST1 and others will have DBHOST2. Can you recommend  some solutions for this scenario.

Michael McMullen

unread,
Dec 3, 2014, 8:38:06 AM12/3/14
to seagull...@googlegroups.com
I am running a Seagull Framework with one main database and all the module's information are in other databases as well.

In the past when using multiple databases I have always had the main database information kept inside the conf.php file. Then I have created another "Configuration" class that will hold any other databases. Each database will be assigned the same permissions as my main database (because its the same site) so I don't need to store user information, etc... but if you need to go that far then you do.

When I use multiple databases I normally write "models" for the database I want to use. So each model will handle the connecting and disconnecting from the DB_DataObject class. You will need a few extra classes to handle some of the pear stuff..

I created a wrapper to connect and disconnect from each of the databases: http://pastebin.com/qWSbJdCj

When I need to generate the database objects for that database I can run a simple function such as: http://pastebin.com/D0C8Aizz

Using those things and maybe some other code i've missed you can switch databases by using the database class

// Database Information
$db_info = ... password stuff here
$mysql_db = new Database_Mysql($db_info['username'], $db_info['password'], $db_info['hostname'], $this->database['database']);
$mysql_db->connect($this->dbh);
The only thing you have to do, is disconnect from the new database and connect back to the old database (your main one) before your action is complete.

$mysql_db->disconnect($this->dbh);

Hopefully that makes sense. The other way to do it would be to check out the PEAR documentation for DataObjects and take a look into the .ini settings. You can define multiple databases in there.



--
You received this message because you are subscribed to the Google Groups "Seagull PHP Framework General Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to seagull_gener...@googlegroups.com.
To post to this group, send email to seagull...@googlegroups.com.
Visit this group at http://groups.google.com/group/seagull_general.
For more options, visit https://groups.google.com/d/optout.



--

host...@gmail.com

unread,
Dec 4, 2014, 12:18:38 AM12/4/14
to seagull...@googlegroups.com
Thanks Michael, I will check this and get back to you if I need anything else.

Thanks.

host...@gmail.com

unread,
Dec 4, 2014, 12:22:33 AM12/4/14
to seagull...@googlegroups.com
Is there any specific folder to copy these 2 files as you mentioned.


On Wednesday, December 3, 2014 7:08:06 PM UTC+5:30, Mickey wrote:

host...@gmail.com

unread,
Dec 4, 2014, 12:23:05 AM12/4/14
to seagull...@googlegroups.com
My scenario  is very just going to change only the host other details remains same.


On Wednesday, December 3, 2014 7:08:06 PM UTC+5:30, Mickey wrote:
Reply all
Reply to author
Forward
0 new messages