Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2012
    Posts
    488
    Plugin Contributions
    0

    Default Strict Standards: Non-static method String::convertCharset() should not be called sta

    Getting errors after updating to php 5.4:

    Strict Standards: Non-static method String::convertCharset() should not be called statically, assuming $this from incompatible context in /htdocs/includes/classes/class.String.php on line 880

    I've tried disabling all of the error reporting/display, but am stuck.




    Any one run into this before?

  2. #2
    Join Date
    Feb 2012
    Location
    mostly harmless
    Posts
    1,809
    Plugin Contributions
    8

    Default Re: PHP 5.4 Strict Errors

    Long term, would probably be a good idea to fix the error in "/includes/classes/class.String.php"...
    The file "/includes/classes/class.String.php" is not part of a stock Zen Cart installation... Any idea where this file came from?

    The file "/includes/extra_configures/enable_error_logging.php" appears to be where error reporting is configured for debug files. If you want to exclude strict error reporting try changing lines 40-44:
    Code:
    /**
     * Error reporting level to log
     * Default: E_ALL ^E_NOTICE
     */
      $errors_to_log = (version_compare(PHP_VERSION, 5.3, '>=') ? E_ALL & ~E_DEPRECATED & ~E_NOTICE : version_compare(PHP_VERSION, 5.4, '>=') ? E_ALL & ~E_DEPRECATED & ~E_NOTICE & ~E_STRICT : E_ALL & ~E_NOTICE);
    Change the order around so when PHP 5.4 or greater is installed & ~E_STRICT is added (which should exclude strict errors from the logs if all goes well).
    Code:
    /**
     * Error reporting level to log
     * Default: E_ALL ^E_NOTICE
     */
      $errors_to_log = (version_compare(PHP_VERSION, 5.4, '>=') ? E_ALL & ~E_DEPRECATED & ~E_NOTICE & ~E_STRICT : version_compare(PHP_VERSION, 5.3, '>=') ? E_ALL & ~E_DEPRECATED & ~E_NOTICE : E_ALL & ~E_NOTICE);
    Note: there is also a copy at "/admin/includes/extra_configures/enable_error_logging.php" you may need to change if the error is being generated from the admin.
    Last edited by lhungil; 24 Sep 2013 at 10:39 PM. Reason: Added note about admin file
    The glass is not half full. The glass is not half empty. The glass is simply too big!
    Where are the Zen Cart Debug Logs? Where are the HTTP 500 / Server Error Logs?
    Zen Cart related projects maintained by lhûngîl : Plugin / Module Tracker

  3. #3
    Join Date
    Jan 2012
    Posts
    488
    Plugin Contributions
    0

    Default Re: PHP 5.4 Strict Errors

    Thank you for this!

    I ended up rolling it back to 5.3 and will attempt it again in the near future. I will track down where class.String.php came from. I think it might be from a Ceon mod.


    Didn't think that the pages would override the error reporting of the php.ini file, so didnt really go looking for it.

 

 

Similar Threads

  1. v151 Non-static method m1_loader::getinstance() should not be called statically
    By louisapple in forum All Other Contributions/Addons
    Replies: 4
    Last Post: 17 Jul 2014, 12:49 AM
  2. USPS Module - how to shorten the ship method string
    By kehrli in forum General Questions
    Replies: 3
    Last Post: 8 Jul 2014, 12:53 AM
  3. Replies: 1
    Last Post: 7 Apr 2013, 02:31 AM
  4. Replies: 2
    Last Post: 5 Jan 2013, 12:21 AM
  5. Can static non-tables-based shipping cost be set for each of my products ?
    By robertwebsite in forum Built-in Shipping and Payment Modules
    Replies: 7
    Last Post: 23 Feb 2011, 01:27 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