Intermittent PHP/mysql site error

by 6 replies
8
I have a php/mysql membership site that has been intermittently giving me the following error:

Catchable fatal error: Object of class __PHP_Incomplete_Class could not be converted to string in (blah blah) (the blah blah is just the url of the page on my site)

I've been getting this error VERY VERY intermittently for a few years now and never had any member complaints (and I have over 10k members) so I always thought it was just me, but I just got the same complaint from one of my members.

The problem is easily solved by simply closing all client browser windows and trying the site again. (Another reason why I always just assumed this was 'just me'.)

However, since I finally had a member complain about this and who was also able to 'fix' this by closing all open browser sessions, I'm starting to wonder...

I've sent some emails to the author of my script and he doesn't seem to have any ideas - I've also 'asked' Google many times and can't come up with anything specific.

Any of the experts here know what this might be? And more importantly, be for hire to take care of this?
#programming #error #intermittent #php or mysql #site
  • The message should have the line number of the statement in error. Could you look in the code and post the line that's causing the problem?
  • The line the error points to contains only this:
    $user = addslashes($_SESSION['user']);
    • [1] reply
    • Intermittent errors can be a nightmare to resolve.

      All I can suggest is changing the code to something like:

      if (!get_magic_quotes_gpc()) {
      $user = addslashes(trim($_SESSION['user']));
      } else {
      $user = trim($_SESSION['user']);
      }
      You may also want to note the user name when this happens. It may be due to some unusual character in the name...
      • [ 1 ] Thanks
  • Just a thought.

    You set the user value by adding slashes to a session variable. Somewhere else are you trying to addslashes again to the same variable?

    Maybe in the class object throwing the error?
    • [ 1 ] Thanks
    • [ 2 ] Thanks
  • KirkMcD,

    Excellent use of Google!

    WP4H

Next Topics on Trending Feed

  • 8

    I have a php/mysql membership site that has been intermittently giving me the following error: Catchable fatal error: Object of class __PHP_Incomplete_Class could not be converted to string in (blah blah) (the blah blah is just the url of the page on my site)