Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Hybrid View

  1. #1
    Join Date
    Dec 2006
    Location
    Hudson Valley, New York USA
    Posts
    93
    Plugin Contributions
    0

    Default Reoccuring DEBUG file functions_lookups.php

    I've recently updated to v1.54 from v1.51 and things appear to be functioning well, however, every once in a while I am getting a DEBUG log file with the following message:

    PHP Warning: strstr(): Empty delimiter in /usr/www/xxx/xxx/xxx/catalog/includes/functions/functions_lookups.php on line 712

    Can anyone point me in a direction as to what might be causing this? The site is NOT down for maintenance when this error occurs. We use PayPal Express and Transaction Express for payment modules. The Transaction express module was provided to me directly from Transaction Express and is not available in the ZenCart plugin section here. I also have Local Sales Taxes plugin installed because we are in NY and are required to charge sales tax based on county.

    Line 712 is in this section of code (I've put 712 in bold):

    Code:
    *
     *  stop regular behavior based on customer/store settings
     *  Used to disable various activities if store is in an operating mode that should prevent those activities
     */
      function zen_run_normal() {
        $zc_run = false;
        switch (true) {
          case (strstr(EXCLUDE_ADMIN_IP_FOR_MAINTENANCE, $_SERVER['REMOTE_ADDR'])):
          // down for maintenance not for ADMIN
            $zc_run = true;
            break;
          case (DOWN_FOR_MAINTENANCE == 'true'):
          // down for maintenance
            $zc_run = false;
            break;
          case (STORE_STATUS >= 1):
          // showcase no prices
            $zc_run = false;
            break;
          case (CUSTOMERS_APPROVAL == '1' and $_SESSION['customer_id'] == ''):
          // customer must be logged in to browse
            $zc_run = false;
            break;
          case (CUSTOMERS_APPROVAL == '2' and $_SESSION['customer_id'] == ''):
          // show room only
          // customer may browse but no prices
            $zc_run = false;
            break;
          case (CUSTOMERS_APPROVAL == '3'):
          // show room only
            $zc_run = false;
            break;
          case (CUSTOMERS_APPROVAL_AUTHORIZATION != '0' and $_SESSION['customer_id'] == ''):
          // customer must be logged in to browse
            $zc_run = false;
            break;
          case (CUSTOMERS_APPROVAL_AUTHORIZATION != '0' and $_SESSION['customers_authorization'] > '0'):
          // customer must be logged in to browse
            $zc_run = false;
            break;
          default:
          // proceed normally
            $zc_run = true;
            break;
        }
        return $zc_run;
      }

  2. #2
    Join Date
    Jul 2012
    Posts
    16,816
    Plugin Contributions
    17

    Default Re: Reoccuring DEBUG file functions_lookups.php

    What do you have for the value of EXCLUDE_ADMIN_IP_FOR_MAINTENANCE? (Configuration, website maintenance section)

    Is it blank. (No spaces, nothing) or does it still have the default text similar to Your Admin IP address?
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  3. #3
    Join Date
    Dec 2006
    Location
    Hudson Valley, New York USA
    Posts
    93
    Plugin Contributions
    0

    Default Re: Reoccuring DEBUG file functions_lookups.php

    It has the following (IP address removed for safety, but I kept the formatting exact)

    your IP (ADMIN),00.00.000.000,00.000.00.000

  4. #4
    Join Date
    Jul 2012
    Posts
    16,816
    Plugin Contributions
    17

    Default Re: Reoccuring DEBUG file functions_lookups.php

    Quote Originally Posted by gwynwyffar View Post
    It has the following (IP address removed for safety, but I kept the formatting exact)

    your IP (ADMIN),00.00.000.000,00.000.00.000
    The text (your IP (ADMIN)) could/should be removed... Not entirely sure that is/would cause the warning. Basically what is happening is that as the code in that section is executed, one or the other side of strstr comparison is empty.. It could technically be either side, but I didn't think that $_SERVER['REMOTE_ADDR'] would likely be empty, but it is a possibility.

    I believe (and hopefully someone else might confirm or deny this) that if the front text of the above is removed up to the first IP value (which yes, I understand is not a grouping of 0's as listed above) and the problem persists that it may be a server setup issue. I also haven't personally compared the above code with fresh install code to identify that all is as it should. Just troubleshooting what has been provided... :)
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  5. #5
    Join Date
    Dec 2006
    Location
    Hudson Valley, New York USA
    Posts
    93
    Plugin Contributions
    0

    Default Re: Reoccuring DEBUG file functions_lookups.php

    Thank you. I'll remove the text and see if it happens again. I had left it the same setting as my old install and that never had any problems, but it could be that 1.5.4 has different error checking. I'll post again if I see more issues.

  6. #6
    Join Date
    Jul 2012
    Posts
    16,816
    Plugin Contributions
    17

    Default Re: Reoccuring DEBUG file functions_lookups.php

    Quote Originally Posted by gwynwyffar View Post
    Thank you. I'll remove the text and see if it happens again. I had left it the same setting as my old install and that never had any problems, but it could be that 1.5.4 has different error checking. I'll post again if I see more issues.
    For clarity sake, it wouldn't be ZC 1.5.4 "error checking" that is providing the warning, but instead a result of the PHP version as that is a PHP function that is producing the warning (which is not an error stopping execution, but an indication that something is not right.)

    Might also want to look through the logs to try to identify any consistent "events" and the generation of the log(s)... May be a single ip address, or some other commonality, but that comparison occurs regardless of the status of the site being in maintenance mode. If the administrator IP is accessing the site, then no further comparisons are done and the administrator is allowed to continue with "normal" operation. If not the administrator IP, then move on down the list until either one of the conditions are met or the default action is taken (which is really a condition to be met as none of the other previous conditions were met.)

    Please report back at some point in the future, if it happens again will probably hear from you sooner than later. :) The result(s) may help others...
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

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

    Default Re: Reoccuring DEBUG file functions_lookups.php

    It's because $_SERVER['REMOTE_ADDR'] is blank for some reason.
    .

    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.

  8. #8
    Join Date
    Aug 2007
    Location
    Gijón, Asturias, Spain
    Posts
    2,826
    Plugin Contributions
    31

    Default Re: Reoccuring DEBUG file functions_lookups.php

    I had that issue some time ago, fixed by this

    http://www.zen-cart.com/showthread.p...81#post1257981
    Steve
    github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...

  9. #9
    Join Date
    Dec 2006
    Location
    Hudson Valley, New York USA
    Posts
    93
    Plugin Contributions
    0

    Default Re: Reoccuring DEBUG file functions_lookups.php

    Just an update. After adjusting my configuration based on mc12345678's suggestion, I still had almost 30 debug files this morning. I think you were right in that someone is pounding on the site, because each file is generated within the space of about 2 minutes. I'll have to work with my web host to check logs to see if there's a particular offending IP.

    I've made the suggested edit to the functions_lookups.php file posted by Torvista and will let you know if that solves the problem.

    Thank you all for your prompt assistance! The Zen-Cart community is awesome!

  10. #10
    Join Date
    Jul 2012
    Posts
    16,816
    Plugin Contributions
    17

    Default Re: Reoccuring DEBUG file functions_lookups.php

    Quote Originally Posted by gwynwyffar View Post
    Just an update. After adjusting my configuration based on mc12345678's suggestion, I still had almost 30 debug files this morning. I think you were right in that someone is pounding on the site, because each file is generated within the space of about 2 minutes. I'll have to work with my web host to check logs to see if there's a particular offending IP.

    I've made the suggested edit to the functions_lookups.php file posted by Torvista and will let you know if that solves the problem.

    Thank you all for your prompt assistance! The Zen-Cart community is awesome!
    When saying that the edit was made, was that the edit of some 56 versions of the statement, or just to the one location of the one file? Seems from that discussion, your added response, and the extra input that my initial suggestion definitely was not, nor would be the solution.

    Hopefully though it will/can be worked out otherwise easily, ideally by the $_SERVER['REMOTE_ADDR'] not being empty.

    Thanks for the report back though and providing an indication of the way forward. :) it's one of those situations like I said, we'll more than likely hear from you while the problem persists, but when it has been resolved the issue will seem like a thing of the past.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 10
    Last Post: 6 Sep 2014, 02:55 AM
  2. v151 How to debug when NO ERROR LOG file created?
    By Jeff_Mash in forum General Questions
    Replies: 8
    Last Post: 24 Jan 2014, 10:50 PM
  3. v150 Checked my DeBug file and ...
    By htlc5 in forum General Questions
    Replies: 2
    Last Post: 7 Mar 2012, 03:54 AM
  4. Debug: USPS.php PHP Warning: Invalid argument supplied for foreach()
    By divinelighting in forum Addon Shipping Modules
    Replies: 2
    Last Post: 11 Jun 2011, 03:17 AM
  5. Where is the log file when you set Debug Mode to "Log File"?
    By alicia1234 in forum Built-in Shipping and Payment Modules
    Replies: 4
    Last Post: 1 Feb 2009, 12:05 AM

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