Page 1 of 3 123 LastLast
Results 1 to 10 of 27
  1. #1
    Join Date
    May 2006
    Location
    Gardiner, Maine
    Posts
    2,296
    Plugin Contributions
    22

    Default PHP warnings suddenly start appearing in the log folder

    Yesterday just as I uploaded one file, php warnings started appearing in the log folder. Not error messages, warnings. I've seen this happen in one other website and was never able to figure it out. In that case, I couldn't pinpoint when it started. I ended up simply writing a script to empty out those logs with a cron job to keep the number of files to a low amount.

    In this case, I can pinpoint the minute this started and it happened at the same time that I uploaded some files. There is nothing in those files I uploaded that would start this as I have used them many times before.

    php version is 5.3.29. Nothing looks out of the norm. There are two installations of zc that are connecting to one database and the warnings are showing in both log folders. I made no changes to one cart at all. The installation I uploaded the files to is a default set of 1.5.1 with some template changes - no core changes and the file I uploaded that has the same time stamp is just a template file. I tried removing it but it didn't stop this from happening.

    I really have to figure this out this time - cart owner is not going to accept my stop gap measure of log file deletion.
    The full-time Zen Cart Guru. WizTech4ZC.com

  2. #2
    Join Date
    Dec 2009
    Location
    Amersfoort, The Netherlands
    Posts
    2,846
    Plugin Contributions
    25

    Default Re: PHP warnings suddenly start appearing in the log folder

    Quote Originally Posted by delia View Post
    Yesterday just as I uploaded one file, php warnings started appearing in the log folder. Not error messages, warnings. I've seen this happen in one other website and was never able to figure it out. In that case, I couldn't pinpoint when it started. I ended up simply writing a script to empty out those logs with a cron job to keep the number of files to a low amount.

    In this case, I can pinpoint the minute this started and it happened at the same time that I uploaded some files. There is nothing in those files I uploaded that would start this as I have used them many times before.

    php version is 5.3.29. Nothing looks out of the norm. There are two installations of zc that are connecting to one database and the warnings are showing in both log folders. I made no changes to one cart at all. The installation I uploaded the files to is a default set of 1.5.1 with some template changes - no core changes and the file I uploaded that has the same time stamp is just a template file. I tried removing it but it didn't stop this from happening.

    I really have to figure this out this time - cart owner is not going to accept my stop gap measure of log file deletion.
    What is the contents of the log file?

    you can use this module myDEGUB Backtrace to obtain more information about erors

  3. #3
    Join Date
    Nov 2007
    Location
    Sunny Coast, Australia
    Posts
    3,379
    Plugin Contributions
    9

    Default Re: PHP warnings suddenly start appearing in the log folder

    Quote Originally Posted by delia View Post
    ...In this case, I can pinpoint the minute this started and it happened at the same time that I uploaded some files. There is nothing in those files I uploaded that would start this as I have used them many times before.
    Obvious questions:

    What happens if you get these new files off the server?
    Is it possible to do this without breaking cart functionality?
    Are you still getting the same warnings after deletion of these new files?

  4. #4
    Join Date
    May 2006
    Location
    Gardiner, Maine
    Posts
    2,296
    Plugin Contributions
    22

    Default Re: PHP warnings suddenly start appearing in the log folder

    [11-Mar-2015 07:06:12 America/New_York] #1 substr() called at [/home/scrappin/public_html/includes/functions/functions_general.php:1039]
    #2 zen_trunc_string() called at [/home/scrappin/public_html/includes/modules/scrappin_stuff/product_listing.php:178]
    #3 include(/home/scrappin/public_html/includes/modules/scrappin_stuff/product_listing.php) called at [/home/scrappin/public_html/includes/templates/scrappin_stuff/templates/tpl_modules_product_listing.php:12]
    #4 require(/home/scrappin/public_html/includes/templates/scrappin_stuff/templates/tpl_modules_product_listing.php) called at [/home/scrappin/public_html/includes/templates/scrappin_stuff/templates/tpl_index_product_list.php:93]
    #5 require(/home/scrappin/public_html/includes/templates/scrappin_stuff/templates/tpl_index_product_list.php) called at [/home/scrappin/public_html/includes/modules/pages/index/main_template_vars.php:217]
    #6 require(/home/scrappin/public_html/includes/modules/pages/index/main_template_vars.php) called at [/home/scrappin/public_html/includes/templates/scrappin_stuff/common/tpl_main_page.php:151]
    #7 require(/home/scrappin/public_html/includes/templates/scrappin_stuff/common/tpl_main_page.php) called at [/home/scrappin/public_html/index.php:97]

    I can delete the files but they aren't new. The files were there - I just uploaded changed files. Getting rid of them leaves me with this only:
    [11-Mar-2015 07:46:47 America/New_York] PHP Warning: substr() expects parameter 3 to be long, string given in /home/scrappin/public_html/m/includes/functions/functions_general.php on line 1016

    I uploaded a fresh version of functions_general.php straight out of the zip file but that didn't stop it.

    It was 1.5.1 I had the problem with before as well. I will be upgrading the other cart shortly but I was not hired to do it for this one.
    The full-time Zen Cart Guru. WizTech4ZC.com

  5. #5
    Join Date
    Dec 2009
    Location
    Amersfoort, The Netherlands
    Posts
    2,846
    Plugin Contributions
    25

    Default Re: PHP warnings suddenly start appearing in the log folder

    the function substr() expects the third parameter to be a of the type "long". You are sending type "string". Try to find out why tpl_index_product_list.php is sending the variable of the type string on line 93

  6. #6
    Join Date
    May 2006
    Location
    Gardiner, Maine
    Posts
    2,296
    Plugin Contributions
    22

    Default Re: PHP warnings suddenly start appearing in the log folder

    Since it's happening in both installations, I don't how it can be caused by specific files. That's the real mystery here, I believe.

    How come you conclude the tpl_index_product_list.php is the culprit? Those files do look to be the same in both installations - the default files.
    The full-time Zen Cart Guru. WizTech4ZC.com

  7. #7
    Join Date
    Dec 2009
    Location
    Amersfoort, The Netherlands
    Posts
    2,846
    Plugin Contributions
    25

    Default Re: PHP warnings suddenly start appearing in the log folder

    sorry, looked at the wrong line

    it should be /home/scrappin/public_html/includes/modules/scrappin_stuff/product_listing.php line 178. This is where zen_trunc_string() is called

  8. #8
    Join Date
    May 2006
    Location
    Gardiner, Maine
    Posts
    2,296
    Plugin Contributions
    22

    Default Re: PHP warnings suddenly start appearing in the log folder

    okay, when I took the product listing out I was still left with this:

    [11-Mar-2015 07:46:47 America/New_York] PHP Warning: substr() expects parameter 3 to be long, string given in /home/xxxxx/public_html/m/includes/functions/functions_general.php on line 1016
    The full-time Zen Cart Guru. WizTech4ZC.com

  9. #9
    Join Date
    May 2006
    Location
    Gardiner, Maine
    Posts
    2,296
    Plugin Contributions
    22

    Default Re: PHP warnings suddenly start appearing in the log folder

    But the weirdest part of this is how the warnings started showing in the installation where I had made no changes at all. It all started in both at the same time.

    Now I'm wondering if having the two separate installations with the same database could have something to do with it. I've never seen it happen before though.
    The full-time Zen Cart Guru. WizTech4ZC.com

  10. #10
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,703
    Plugin Contributions
    123

    Default Re: PHP warnings suddenly start appearing in the log folder

    Can you get a traceback on this so we can see the calling line?
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

 

 
Page 1 of 3 123 LastLast

Similar Threads

  1. how to point to the right admin log in folder
    By Pxtures in forum Basic Configuration
    Replies: 4
    Last Post: 18 Jun 2014, 02:29 PM
  2. v150 Suddenly receiving a bunch of warnings - no code changed.
    By kalastaja in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 31 Mar 2014, 06:10 PM
  3. PayPal Instant Payment Notification Warnings suddenly
    By ewramos in forum Built-in Shipping and Payment Modules
    Replies: 7
    Last Post: 5 Jul 2011, 08:37 AM
  4. Help! Suddenly can't log in to the admin panel
    By krusedull in forum General Questions
    Replies: 8
    Last Post: 3 Jun 2011, 08:35 PM
  5. Where do I put the Zen folder to start the install?
    By ms paperlicious in forum Installing on a Mac Server
    Replies: 3
    Last Post: 8 Jun 2007, 03:11 AM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR