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

Hybrid View

  1. #1
    Join Date
    Jan 2004
    Location
    N of San Antonio TX
    Posts
    9,106
    Plugin Contributions
    11

    Default [Fixed v1.5.1] PHP Warning: strlen() expects parameter 1 to be string

    This continues to mess with my brain (an admittedly easy task!).

    Several of our sites are getting
    PHP Warning: strlen() expects parameter 1 to be string, array given in /home/site_name/public_html/includes/functions/functions_general.php on line 152
    Commonalities are minimal other than all sites effected are 1.3.9h and all debug files to the cache directory are timestamped at the conclusion of an order. All have IH2 and Fual Slimbox. Some have captcha and newsletter subscription, but we get the error on sites with neither, just one, or both of those mods.

    Whether the site is using AIM, PayPal, Ceon's offline, or some other payment module seems to make no difference. AND, only occasionally does any site throw this error. One site has 25+ orders this month with a mixture of PayPal and AIM. Only two orders (one for each) has thrown the error.

    We have checked and re-checked for current PayPal and AIM files along with other payment mods.

    No changes have been made to customer database settings or files gathering/forwarding customer data.

    If it would JUST BREAK already, we could fix it.

    Any suggestions of other things we might check would be GREATLY appreciated.

  2. #2
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,761
    Plugin Contributions
    9

    Default Re: PHP Warning: strlen() expects parameter 1 to be string

    Not that I can assist but you left out php ver & mysql ver
    Zen-Venom Get Bitten

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

    Default Re: PHP Warning: strlen() expects parameter 1 to be string

    Try inserting above l 152:

    if (is_null($value)) continue;
    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.

  4. #4
    Join Date
    Jan 2004
    Location
    N of San Antonio TX
    Posts
    9,106
    Plugin Contributions
    11

    Default Re: PHP Warning: strlen() expects parameter 1 to be string

    Should read my sig, huh?

    PHP 5.3.3 MySQL 5.0.67 for all.

  5. #5
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,761
    Plugin Contributions
    9

    Default Re: PHP Warning: strlen() expects parameter 1 to be string

    Did you try the suggestion from swguy?

    Looks to be a workaround, but there must be a root cause as I have never seen this error
    Zen-Venom Get Bitten

  6. #6
    Join Date
    Jan 2004
    Location
    N of San Antonio TX
    Posts
    9,106
    Plugin Contributions
    11

    Default Re: PHP Warning: strlen() expects parameter 1 to be string

    definitely a work around and will take days or weeks to see if it works, but will stick it in a couple of the more active sites.

    I've come close to finding similar items in the forum, but just when you think you might have found the answer.......

  7. #7
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: PHP Warning: strlen() expects parameter 1 to be string

    Quote Originally Posted by dbltoe View Post
    Any suggestions of other things we might check would be GREATLY appreciated.
    From a diagnostics perspective, you could try to capture information about whatever the offending component is by inserting this line at line 152:
    Code:
            if (is_array($value)) trigger_error('GET param found to be array: ' . print_r($value, true) . '  --- contents of GET: ' . print_r($_GET, true));
    Depending on your PHP configuration, that should dump the offending details into the myDebug-xxxxx.log logs, as per https://www.zen-cart.com/tutorials/index.php?article=82

    DO NOT TRY THIS IF YOU ARE USING A VERSION OLDER THAN v1.3.9a !!!!!!!!!
    .

    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,571
    Plugin Contributions
    30

    Default Re: PHP Warning: strlen() expects parameter 1 to be string

    I got a debug file with this identical error today.
    First error ever on the live shop.

    Order confirmed at 15:19:58 (using 4b payment module, Spain)
    Debug Warning at 15:20:24

    ZC 1.39h
    PHP Version: 5.3.8 (Zend: 2.3.0)
    PHP Safe Mode: Off
    PHP Memory Limit: 128M
    Database: MySQL 5.0.92-community-log
    HTTP Server: Apache

    Main mods, IH2, Ceon Advanced Shipper, 4b payment module...a long list.

    I've put in the suggested debug code.
    Steve
    github.com/torvista: Spanish Language Pack, Google reCaptcha, Structured Data, Multiple Copy-Move-Delete, Image Checker, BackupMySQL Admin/Auto...

  9. #9
    Join Date
    Aug 2007
    Location
    Gijón, Asturias, Spain
    Posts
    2,571
    Plugin Contributions
    30

    Default Re: PHP Warning: strlen() expects parameter 1 to be string

    Ok, I got two of these today.

    1)
    Order at 10:53:12
    Debug at 10:54:01
    Payment - Moneyorder
    Shipping - Advanced Shipper
    [06-Oct-2011 10:54:01] PHP Notice: GET param found to be array: Array
    (
    [0] => 47
    )
    --- contents of GET: Array
    (
    [main_page] => index
    [action] => notify
    [notify] => Array
    (
    [0] => 47
    )

    )
    in /whatever/includes/functions/functions_general.php on line 152
    [06-Oct-2011 10:54:01] PHP Warning: strlen() expects parameter 1 to be string, array given in /whatever/includes/functions/functions_general.php on line 153
    2)
    Order at 11:48:57
    Debug at 11:49:25
    Payment - 4b (offsite credit card gateway)
    Shipping - Advanced Shipper
    [06-Oct-2011 11:49:25] PHP Notice: GET param found to be array: Array
    (
    [0] => 56
    )
    --- contents of GET: Array
    (
    [main_page] => index
    [action] => notify
    [notify] => Array
    (
    [0] => 56
    )

    )
    in /whatever/includes/functions/functions_general.php on line 152
    [06-Oct-2011 11:49:25] PHP Warning: strlen() expects parameter 1 to be string, array given in /whatever/includes/functions/functions_general.php on line 153
    I don't find anything I can relate to those numbers 47 and 56 in the order.

    So, any more clues I can give you?

    Thanks
    Steve
    Steve
    github.com/torvista: Spanish Language Pack, Google reCaptcha, Structured Data, Multiple Copy-Move-Delete, Image Checker, BackupMySQL Admin/Auto...

  10. #10
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: PHP Warning: strlen() expects parameter 1 to be string

    Why are you passing a [notify] in your $_GET in the first place? What addon is doing that, and why?
    .

    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.

 

 
Page 1 of 2 12 LastLast

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: addslashes() expects parameter 1 to be string, array given
    By schoolboy in forum All Other Contributions/Addons
    Replies: 11
    Last Post: 10 May 2013, 02:19 PM
  3. v139e PHP Warning: strlen() expects parameter 1 to be string, array given in
    By irishshopper in forum Basic Configuration
    Replies: 4
    Last Post: 7 Mar 2013, 08:06 PM
  4. v139h PHP Warning: strip_tags() expects parameter 1 to be string, array given
    By BlessIsaacola in forum General Questions
    Replies: 1
    Last Post: 6 Mar 2012, 01:32 PM
  5. v150 PHP Warning: strlen() expects parameter 1 to be string, array given
    By caffeitalia in forum General Questions
    Replies: 1
    Last Post: 1 Feb 2012, 03:17 PM

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