Results 1 to 9 of 9

Hybrid View

  1. #1
    Join Date
    May 2008
    Posts
    28
    Plugin Contributions
    0

    Default Who's Online Problem

    Hey guys.

    i am getting the error

    Fatal error: Maximum execution time of 30 seconds exceeded in whos_online.php on line 410

    When nobody has been on the site no problems but when there are people on the site it takes for ever to load the page and stats the above error.

    Any help??

  2. #2
    Join Date
    Aug 2004
    Location
    Fountain Hills, AZ
    Posts
    515
    Plugin Contributions
    1

    help question Re: Who's Online Problem - Fatal Error - urgent

    I have two sites on a new server running Php 5.25 and MySql 5.045 - Both sites having issues with the Who's Online Module. Both sites are the latest release of Zen - 1.3.8a with the standard version of Who's Online that comes with the package,

    When you go to the page it continues to load forever - finally I received the following fatal error Fatal error: Maximum execution time of 60 seconds exceeded in whos_online.php on line 410. and of course as has been mentioned in the forums here, the load on the server starts to climb like crazy.

    I have several other sites on PHP 4 servers and Who's Online works with out issue. Is this an issue with PHP5 and if so, does anyone have any suggestions on what code modifications would stop the continual loading of the page?

    My customer is screaming as they really use that functionality and I'm not sure what to do here. Any help would be appreciated.

  3. #3
    Join Date
    Aug 2004
    Location
    Fountain Hills, AZ
    Posts
    515
    Plugin Contributions
    1

    Default Re: Who's Online Problem - fixed

    In reviewing the code based on the error message, I found the issued lied in this area (around line 661 starting with if ($length = strlen($session_data)) {

    The entire piece of code creating the loop -
    PHP Code:
    if ($length strlen($session_data)) {
          if (
    PHP_VERSION 4) {
            
    $start_id strpos($session_data'customer_id[==]s');
            
    $start_cart strpos($session_data'cart[==]o');
            
    $start_currency strpos($session_data'currency[==]s');
            
    $start_country strpos($session_data'customer_country_id[==]s');
            
    $start_zone strpos($session_data'customer_zone_id[==]s');
          } else {
            
    $start_id strpos($session_data'customer_id|s');
            
    $start_cart strpos($session_data'cart|O');
            
    $start_currency strpos($session_data'currency|s');
            
    $start_country strpos($session_data'customer_country_id|s');
            
    $start_zone strpos($session_data'customer_zone_id|s');
          }

          for (
    $i=$start_cart$i<$length$i++) {
            if (
    $session_data[$i] == '{') {
              if (isset(
    $tag)) {
                
    $tag++;
              } else {
                
    $tag 1;
              }
            } elseif (
    $session_data[$i] == '}') {
              
    $tag--;
            } elseif ( (isset(
    $tag)) && ($tag 1) ) {
              break;
            }
          } 
    I modified the code as follows and now all is working perfect on both sites.

    PHP Code:
    if ($length strlen($session_data)) {

          if (
    PHP_VERSION 4) {

            
    $start_id strpos($session_data'customer_id[==]s');
            
    $start_cart strpos($session_data'cart[==]o');
            
    $start_currency strpos($session_data'currency[==]s');
            
    $start_country strpos($session_data'customer_country_id[==]s');
            
    $start_zone strpos($session_data'customer_zone_id[==]s');

          } 

          for (
    $i=$start_cart$i<$length$i++) {

            if (
    $session_data[$i] == '{') {

              if (isset(
    $tag)) {

                
    $tag++;

              } else {

                
    $tag 1;

              }

            } elseif (
    $session_data[$i] == '}') {

              
    $tag--;

            } elseif ( (isset(
    $tag)) && ($tag 1) ) {

              break;

            }

          } 
    This was only needed if you are running on a PHP 5 server. If this change will create other issues I'm not aware of, please someone jump in there!!

    Thanks

  4. #4
    Join Date
    Apr 2007
    Location
    Herts. UK
    Posts
    890
    Plugin Contributions
    4

    Default Re: Who's Online Problem

    Hi,

    I believe the problem is caused by the use of suhosin with PHP. Check if you are using suhosin and if so then turn it off or at least turn off its session encryption.

    Regards,
    Christian.

  5. #5
    Join Date
    Aug 2004
    Location
    Fountain Hills, AZ
    Posts
    515
    Plugin Contributions
    1

    Default Re: Who's Online Problem

    Suhosin is part of the server hardening process and turning it off, I don't believe is a very good option. Removing the offending code worked like a charm on this end, unless you know of any other issues that, that code modification could create for us. If so, please advise.

    An added note: When before I removed that code we were experiencing definite server load issues. Removing, also stopped that issue completely. Now refreshing the Who's Online on a very busy site has no affect on the load.

    Thanks for your input. As always it is very appreciated.

    Ruth

  6. #6
    Join Date
    Apr 2007
    Location
    Herts. UK
    Posts
    890
    Plugin Contributions
    4

    Default Re: Who's Online Problem

    Quote Originally Posted by rwoody View Post
    Suhosin is part of the server hardening process and turning it off, I don't believe is a very good option. Removing the offending code worked like a charm on this end, unless you know of any other issues that, that code modification could create for us. If so, please advise.
    As far as I am aware the current version of Zen Cart has not been designed for or tested in a hardened PHP environment. What other problems you may encounter is unknown.

    Does the Who's Online screen fully work with the modification you made? If a visitor adds something to their cart can you see the cart contents on the Who's online screen?

    Regards,
    Christian.

 

 

Similar Threads

  1. v138a who's online problem after moving to VPS
    By sjbglx in forum General Questions
    Replies: 10
    Last Post: 11 Dec 2013, 08:46 AM
  2. Problem loading who's online
    By longstockings in forum General Questions
    Replies: 1
    Last Post: 21 Jul 2010, 06:09 PM
  3. Who's Online Problem
    By giftsbyevy in forum General Questions
    Replies: 4
    Last Post: 2 Mar 2010, 02:21 AM
  4. [Not a bug] Who's Online problem?
    By jrafuse in forum Bug Reports
    Replies: 1
    Last Post: 30 Mar 2008, 01:34 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg