Results 1 to 8 of 8
  1. #1
    Join Date
    Oct 2004
    Posts
    1,045
    Plugin Contributions
    0

    Default PHP Warning: fread() : Length parameter must be greater than 0 ...

    I am getting the following error in the debug logs everytime an order is placed:

    [23-Oct-2013 11:51:38] PHP Warning: fread() [<a href='function.fread'>function.fread</a>]: Length parameter must be greater than 0 in /home3/***/public_html/shop/includes/functions/functions_email.php on line 414

    This is line 414:

    $file_holder = fread($fh, filesize($template_filename));

    I have searched the forums, but have been unable to find a solution. Can anyone help me understand how to fix this error?

    Thanks!

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

    Default Re: PHP Warning: fread() [<a href='function.fread'>function.fread</a>]:

    Which ZC version are you using?

  3. #3
    Join Date
    Oct 2004
    Posts
    1,045
    Plugin Contributions
    0

    Default Re: PHP Warning: fread() [<a href='function.fread'>function.fread</a>]:

    Version 1.3.8a

  4. #4
    Join Date
    Oct 2004
    Posts
    1,045
    Plugin Contributions
    0

    Default Re: PHP Warning: fread() [<a href='function.fread'>function.fread</a>]:

    We are also getting this error at checkout, which I would assume is related:

    Email error: Could not instantiate mail function. Please check Admin->Configuration->Email Options->Email Transport.

    I have checked those settings, and they are correct. We are able to send and receive e-mails, and the Email Archive Manager confirms that e-mails are going through. I'm not sure what else to do to fix these problems?

  5. #5
    Join Date
    Oct 2004
    Posts
    1,045
    Plugin Contributions
    0

    Default Re: PHP Warning: fread() [<a href='function.fread'>function.fread</a>]:

    Actually, weirdly, they were unrelated issues. We have resolved the Email Error, but are still getting the error in the debug log about the length parameter.

    Quote Originally Posted by Danielle View Post
    We are also getting this error at checkout, which I would assume is related:

    Email error: Could not instantiate mail function. Please check Admin->Configuration->Email Options->Email Transport.

    I have checked those settings, and they are correct. We are able to send and receive e-mails, and the Email Archive Manager confirms that e-mails are going through. I'm not sure what else to do to fix these problems?

  6. #6
    Join Date
    Jul 2007
    Posts
    2,169
    Plugin Contributions
    16

    Default Re: PHP Warning: fread() [<a href='function.fread'>function.fread</a>]:

    Quote Originally Posted by Danielle View Post
    I am getting the following error in the debug logs everytime an order is placed:

    [23-Oct-2013 11:51:38] PHP Warning: fread() [<a href='function.fread'>function.fread</a>]: Length parameter must be greater than 0 in /home3/***/public_html/shop/includes/functions/functions_email.php on line 414

    This is line 414:

    $file_holder = fread($fh, filesize($template_filename));

    I have searched the forums, but have been unable to find a solution. Can anyone help me understand how to fix this error?

    Thanks!


    Quote Originally Posted by Danielle View Post
    Version 1.3.8a
    You DO need to upgrade, to another version of zen cart. You should upgrade to V1.3.9h (minimum) or preferably, V1.5.1.. There are several known vulnerabilities with Zen V1.3.8(a) that are being actively exploited. The zen cart you are running is well out of date and full of security vulnerability and not supported any longer. You should really invest in the time to bring you zen cart version up to date.
    Is your site Upgraded to the current version 1.5.4 Yet?
    zencart-upgrades-website-installation

  7. #7
    Join Date
    Oct 2004
    Posts
    1,045
    Plugin Contributions
    0

    Default Re: PHP Warning: fread() [<a href='function.fread'>function.fread</a>]:

    Yes I know. Unfortunately the client does not want to upgrade at this time.

    Quote Originally Posted by countrycharm View Post
    You DO need to upgrade, to another version of zen cart. You should upgrade to V1.3.9h (minimum) or preferably, V1.5.1.. There are several known vulnerabilities with Zen V1.3.8(a) that are being actively exploited. The zen cart you are running is well out of date and full of security vulnerability and not supported any longer. You should really invest in the time to bring you zen cart version up to date.

  8. #8
    Join Date
    Jan 2004
    Posts
    66,450
    Plugin Contributions
    81

    Default Re: PHP Warning: fread() : Length parameter must be greater than 0 ...

    If filesize($template_filename) is returning a 0 or null, then chances are your server's filesystem is refusing to return filesize data about the files when PHP asks for it.
    Contact the server administrator for assistance.
    .
    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.

 

 

Similar Threads

  1. v153 PHP Warning: addslashes() expects parameter 1 to be string
    By BlackOrchidCouture in forum General Questions
    Replies: 2
    Last Post: 17 Sep 2014, 10:47 PM
  2. PHP Warning: mktime() expects parameter 6 to be long
    By milkyway in forum Built-in Shipping and Payment Modules
    Replies: 7
    Last Post: 29 Dec 2010, 03:19 PM
  3. PHP Warning mktime() expects parameter 6 to be long
    By dave_dave in forum General Questions
    Replies: 2
    Last Post: 2 Sep 2010, 04:41 AM
  4. Price To must be greater than or equal to Price From
    By CaroleAs in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 15 Feb 2009, 10:25 PM
  5. Replies: 3
    Last Post: 5 Feb 2008, 05:16 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