Page 1 of 5 123 ... LastLast
Results 1 to 10 of 42
  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,621
    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
    Location
    N of San Antonio TX
    Posts
    9,106
    Plugin Contributions
    11

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

    Narrowed down to something coming from authorize.net in completing a purchase. Error was on the 13th and it's coming 25 seconds after the purchase is logged.

    Odd that it doesn't happen on the 15th. Only difference I can see between the two orders is that the 15th has a different shipping from billing.


  8. #8
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

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

    If the warning is triggering on strlen($value), try moving that to the end of the testing list so other conditions are parsed first.

    The strlen() function wants a string, and if one of the keys holds an array, that would probably be the cause. What could the 'error' consist of?
    && ($key != 'error')
    It would cease processing if $key did equal 'error'.
    PHP Code:
            if ( (strlen($value) > 0) && ($key != 'main_page') && ($key != zen_session_name()) && ($key != 'error') && (!in_array($key$exclude_array)) && ($key != 'x') && ($key != 'y') ) { 
    Last edited by gjh42; 17 Apr 2011 at 01:14 AM.

  9. #9

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

    did anyone find out what to do to solve this php warming?

    I am having the same problem....


  10. #10
    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

    Still rearing it's ugly head from time to time but have not aggressively pursued it as I can't seem to find anything that dies because of it.

    Are you actually able to determine anything that is not working due to this error?

 

 
Page 1 of 5 123 ... 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