Site maintenance: Sun 15 Nov, from 20:00 UTC, about 4–6 hours. Details

This cutover relies on some testing that is still incomplete so may be cancelled at short notice

Forums / Installing on a Windows Server / explode() expects parameter 2 to be string ... in functions_general.php line 566

explode() expects parameter 2 to be string ... in functions_general.php line 566

Locked

Started by surlybroad on 19 May 2010, 4:54 AM · Views: 17,731

Results 1 to 10 of 10
This thread is locked. New replies are disabled.
19 May 2010, 4:54 AM
#1
surlybroad avatar

surlybroad

New Zenner

Join Date:
Mar 2010
Location:
northern california coast
Posts:
11
Plugin Contributions:
0

explode() expects parameter 2 to be string ... in functions_general.php line 566

Hi everybody!

I recently installed zen-cart ver 1.39b and I'm developing my website on my localhost before going "live."

My DEBUG log reveals the following error:

"PHP Warning: explode() expects parameter 2 to be string, array given in C:\xampp\htdocs\catalog\includes\functions\functions_general.php on line 566

The section of code referred to in the error log is as follows:

// Return a product ID from a product ID with attributes
function zen_get_prid($uprid) {
$pieces = explode(':', $uprid);

  return $pieces[0];  }

Line 566 is the line that reads:
$pieces = explode(':', $uprid);

According to the log, this error is reoccurring.

I haven't touched the functions_general.php file and have no idea why I'm getting this error or how to fix it.

Any assistance would be very much appreciated.

Thank you.

19 May 2010, 7:57 AM
#2
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: explode() expects parameter 2 to be string ... in functions_general.php line 566

I recently installed zen-cart ver 1.39b and I'm developing my website on my localhost
You should supply what versions of apache, mysql, and php your local is running

Zen-Venom Get Bitten

19 May 2010, 5:28 PM
#3
surlybroad avatar

surlybroad

New Zenner

Join Date:
Mar 2010
Location:
northern california coast
Posts:
11
Plugin Contributions:
0

Re: explode() expects parameter 2 to be string ... in functions_general.php line 566

I'm sorry. I'm using:

  • Apache 2.2.14
  • MySQL 5.1.41
  • PHP 5.3.1
25 May 2010, 8:59 PM
#4
surlybroad avatar

surlybroad

New Zenner

Join Date:
Mar 2010
Location:
northern california coast
Posts:
11
Plugin Contributions:
0

Re: explode() expects parameter 2 to be string ... in functions_general.php line 566

I don't know what happened, but the problem no longer exists. Thanks for your interest in helping me.

24 Jun 2010, 1:17 AM
#5
jetx avatar

jetx

Zen Follower

Join Date:
Apr 2006
Posts:
425
Plugin Contributions:
0

Re: explode() expects parameter 2 to be string ... in functions_general.php line 566

I've noticed this error 3 times today from 3 different visitors (a live site version 1.39d), php 5.3.2, Apache 2.2.15, MySQL 5.0.90.

Note: checked all the changed files, including functions_general.php and all appear to have updated correctly (file dates and size).

Any ideas (before I re-install updates or update Apache, etc)?

24 Jun 2010, 1:39 AM
#6
jetx avatar

jetx

Zen Follower

Join Date:
Apr 2006
Posts:
425
Plugin Contributions:
0

Re: explode() expects parameter 2 to be string ... in functions_general.php line 566

Note: This obviously was not on a Windows server, but the same error: "PHP Warning: explode() expects parameter 2 to be string, array given in.. line 566".

More info after looking at logs: Example: After a new customer placed an order via Paypal Express, error occurred between the time of returning from Paypal to checkout confirmation and logging off.

24 Jun 2010, 3:00 AM
#7
jetx avatar

jetx

Zen Follower

Join Date:
Apr 2006
Posts:
425
Plugin Contributions:
0

Re: explode() expects parameter 2 to be string ... in functions_general.php line 566

I've upgraded MySQL to 5.1.46, will see if that helps.

24 Jun 2010, 6:21 AM
#8
jetx avatar

jetx

Zen Follower

Join Date:
Apr 2006
Posts:
425
Plugin Contributions:
0

Re: explode() expects parameter 2 to be string ... in functions_general.php line 566

Upgrading MySQL made no difference.

Contribs include only the following: Ceon Manual Card, Column Divider Pro, Contactus Recaptcha, Direct Bank Deposit, Reward Points, ckeditor plugin for zen, and a template (Modern Zen) and Ceon advshipper and zones (commercial add-ons). All (so far as I know) the latest updates.

26 Jun 2010, 2:22 AM
#9
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
Plugin Contributions:
176

Re: explode() expects parameter 2 to be string ... in functions_general.php line 566

Does this suggested fix resolve the problem for you? http://www.zen-cart.com/forum/showthread.php?t=158213

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

26 Jun 2010, 4:05 AM
#10
jetx avatar

jetx

Zen Follower

Join Date:
Apr 2006
Posts:
425
Plugin Contributions:
0

Re: explode() expects parameter 2 to be string ... in functions_general.php line 566

DrByte:

Does this suggested fix resolve the problem for you? http://www.zen-cart.com/forum/showthread.php?t=158213

That appears to have fixed it. Thanks for the link.