Results 1 to 10 of 10
  1. #1
    Join Date
    May 2011
    Posts
    5
    Plugin Contributions
    0

    Default Large Debug Cache files - problems in tpl_spots_sidebox.php

    I am using Zen cart v. 1.3.9h. I have 2 other instances of zen that I am using. Only one instance exhibits the problem.

    Something is creating numerous large files in the cache folder. In 10 minutes something has created 2 debug files each over 148 mb. My hosting service is no happy about the files.

    Any help would be appreciated.

  2. #2
    Join Date
    Apr 2006
    Location
    Texas
    Posts
    6,196
    Plugin Contributions
    0

    Default Re: Large Debug Cache files

    Please post back the last 4 errors for help...

    root directory/ cache

  3. #3
    Join Date
    May 2011
    Posts
    5
    Plugin Contributions
    0

    Default Re: Large Debug Cache files

    The last debug file was labeled:

    myDEBUG-1306278111-730530.log

    another just came in:

    myDEBUG-1306280854-988367.log

  4. #4
    Join Date
    Oct 2006
    Location
    Alberta, Canada
    Posts
    4,571
    Plugin Contributions
    1

    Default Re: Large Debug Cache files

    Can you post the first 4 lines of either debug file?
    (In whatever you post, remove the first two dir's of your hosting account path for security reasons.)

    Also, are you using ImageHandler 2 and if yes, have you updated it to use the version for Zen Cart 1.3.9h?

  5. #5
    Join Date
    May 2011
    Posts
    5
    Plugin Contributions
    0

    Default Re: Large Debug Cache files

    1 16:48:01] PHP Warning: feof(): supplied argument is not a valid stream resource in /-/includes/templates/template_default/sideboxes/tpl_spots_sidebox.php on line 57
    [24-May-2011 16:48:01] PHP Warning: fgets(): supplied argument is not a valid stream resource in -/includes/templates/template_default/sideboxes/tpl_spots_sidebox.php on line 59
    [24-May-2011 16:48:01] PHP Warning: feof(): supplied argument is not a valid stream resource in -/includes/templates/template_default/sideboxes/tpl_spots_sidebox.php on line 57
    [24-May-2011 16:48:01] PHP Warning: fgets(): supplied argument is not a valid stream resource in -/includes/templates/template_default/sideboxes/tpl_spots_sidebox.php on line 59

  6. #6
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: Large Debug Cache files

    There is no "tpl_spots_sidebox.php" file in original Zen Cart. What addon did that come from? Clearly it's got a bug in it. What's it doing from lines 10-60?
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  7. #7
    Join Date
    May 2011
    Posts
    5
    Plugin Contributions
    0

    Default Re: Large Debug Cache files - problems in tpl_spots_sidebox.php

    It is a side box that was added in the past by someone no loner around. It adds metals prices in a sidebox. I had totally forgotten it had been added.


    <?php


    /**


    * blank sidebox - allows a blank sidebox to be added to your site


    *


    * @package templateSystem


    * @copyright 2007 Kuroi Web Design


    * @copyright Portions Copyright 2003-2007 Zen Cart Development Team


    * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0


    * @version $Id: blank_sidebox.php 2007-05-26 kuroi $


    */




    $content = '';


    $content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent">';




    // Replace the text and HTML tags between the apostophes on lines 19 and 20.

    // Use as many or as few lines using this model as you need for your custom content.
    // If you have a multilingual site define your text in the languages/YOUR_LANGUAGE/extra_definitions/blank_sidebox_defines.php and include it as shown in line 19.
    // If your site is monolingual, you can put the text right here as shown on line 20 (and nobody will know!)

    $content .= '<center><p><a href=index.php?main_page=page_4>' . TEXT_SPOTS_SIDEBOX . '</a></p></center>';

    $gold = 0;
    $silver = 0;
    $platinum = 0;
    $palladium = 0;
    $file = fopen("http://a.coinnet.com/cgi-bin/freebie" , "r");

    $content .= "<table><tr><td></td><td>Last</td><td>Change</td></tr>";

    while(!feof($file)){

    $line = fgets($file);

    $line = preg_replace("/<.*?>/", "", $line);
    if(preg_match("/Gold/", $line)&& $gold == 0){
    $s1 = fgets($file);
    $s1 = preg_replace("/<.*?>/", "", $s1);
    $s2 = fgets($file);
    $s2 = preg_replace("/<.*?>/", "", $s2);
    $s3 = fgets($file);
    $s3 = preg_replace("/<.*?>/", "", $s3);
    $content .= "<tr><td>". $line . "</td><td>". $s1 . "</td><td>". $s3 . "</td></tr>";
    $gold ++;
    }elseif (preg_match("/Silver/", $line) && $silver == 0){
    $s1 = fgets($file);
    $s1 = preg_replace("/<.*?>/", "", $s1);
    $s2 = fgets($file);
    $s2 = preg_replace("/<.*?>/", "", $s2);
    $s3 = fgets($file);
    $s3 = preg_replace("/<.*?>/", "", $s3);
    $content .= "<tr><td>". $line . "</td><td>". $s1 . "</td><td>". $s3 . "</td></tr>";
    $silver ++;
    }elseif (preg_match("/Platinum/", $line) && $platinum == 0){
    $s1 = fgets($file);
    $s1 = preg_replace("/<.*?>/", "", $s1);
    $s2 = fgets($file);
    $s2 = preg_replace("/<.*?>/", "", $s2);
    $s3 = fgets($file);
    $s3 = preg_replace("/<.*?>/", "", $s3);
    $content .= "<tr><td>". $line . "</td><td>". $s1 . "</td><td>". $s3 . "</td></tr>";
    $platinum ++;
    }elseif (preg_match("/Palladium/", $line) && $palladium == 0){
    $s1 = fgets($file);
    $s1 = preg_replace("/<.*?>/", "", $s1);
    $s2 = fgets($file);
    $s2 = preg_replace("/<.*?>/", "", $s2);
    $s3 = fgets($file);
    $s3 = preg_replace("/<.*?>/", "", $s3);
    $content .= "<tr><td>". $line . "</td><td>". $s1 . "</td><td>". $s3 . "</td></tr>";
    $palladium ++;
    }

    }

    $content .= "</table>";





    //$content .= '<p><a href=index.php?main_page=page_4>Click Here</a></p></center>';

    $content .= '</div>';

  8. #8
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: Large Debug Cache files - problems in tpl_spots_sidebox.php

    Code:
    $file = fopen("http://a.coinnet.com/cgi-bin/freebie" , "r");
    That line is trying to use a PHP function named "fopen" to access an external website (a.coinnet.com) to "read" (the "r") the data on that page.

    Many hosting companies nowadays specifically prohibit "fopen" from accessing external websites (allow_url_fopen = off) for security reasons, since hackers/phishers will often use that very approach for nefarious reasons.
    So, it could be that your hosting company (or your server administrator, whoever controls the master PHP configuration on that server) has specifically changed things to be more secure, and the side-effect is that the errors you reported are now being triggered.

    If your hosting company won't re-allow access to that URL, then you might need to rewrite the PHP to use something like CURL to read the data, and then also rewrite the code that parses it (all the fgets and feof etc function calls) to loop thru the data a little differently in order to get the desired end result.

    Or, if the sidebox is no longer really needed, you could just turn it off and that particular problem goes away.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  9. #9
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: Large Debug Cache files - problems in tpl_spots_sidebox.php

    Hmmm ... actually ... the problem may be even worse than that ...

    If you try visiting that URL with your browser, you'll see that the page is blank and a "not found" error is returned.

    So, whether that allow_url_fopen is set or not, you're still gonna get no useful data back.

    If you want the functionality that that sidebox was giving at one time, you'll need to find another source for the data before you even bother considering the best method of reading and parsing the data for use.

    For now I suggest turning off the sidebox: Admin->Tools->Layout Boxes Controller.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  10. #10
    Join Date
    May 2011
    Posts
    5
    Plugin Contributions
    0

    Default Re: Large Debug Cache files - problems in tpl_spots_sidebox.php

    I already turned it off.

    Thanks for the help.

 

 

Similar Threads

  1. v151 "500" on Cleanup Debug Log Files, PHP 5.4
    By rayw1679 in forum General Questions
    Replies: 5
    Last Post: 5 Mar 2013, 07:06 AM
  2. Debug files filling up my Cache on Zen 139H
    By tbokich in forum General Questions
    Replies: 2
    Last Post: 28 Apr 2011, 07:09 AM
  3. PHP Error - Blank Page w/ log files from debug utility.
    By jester8131 in forum General Questions
    Replies: 2
    Last Post: 5 Feb 2010, 05:35 AM
  4. AIM debug files in cache folder
    By earmsby in forum Built-in Shipping and Payment Modules
    Replies: 2
    Last Post: 31 Dec 2007, 07:43 PM
  5. Replies: 1
    Last Post: 26 Jun 2007, 05:06 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