Intermittent PHP/mysql site error

6 replies
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?
#error #intermittent #php or mysql #site
  • Profile picture of the author CBSnooper
    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?
    {{ DiscussionBoard.errors[3220391].message }}
  • Profile picture of the author webpromotions
    The line the error points to contains only this:
    $user = addslashes($_SESSION['user']);
    {{ DiscussionBoard.errors[3220444].message }}
    • Profile picture of the author Havenhood
      Originally Posted by Doug English View Post

      The line the error points to contains only this:
      $user = addslashes($_SESSION['user']);
      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...
      Signature

      --= -Spazzle- =--

      {{ DiscussionBoard.errors[3220664].message }}
  • Profile picture of the author stma
    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?
    {{ DiscussionBoard.errors[3220916].message }}
  • {{ DiscussionBoard.errors[3220967].message }}
  • Profile picture of the author webpro4hire
    KirkMcD,

    Excellent use of Google!

    WP4H
    {{ DiscussionBoard.errors[3224147].message }}

Trending Topics