Forums / Addon Payment Modules / Fatal error: Cannot redeclare class soapclient

Fatal error: Cannot redeclare class soapclient

Locked

Started by srw134 on 4 Nov 2007, 9:01 AM · Views: 6,976

Results 1 to 5 of 5
This thread is locked. New replies are disabled.
4 Nov 2007, 9:01 AM
#1
srw134 avatar

srw134

New Zenner

Join Date:
Sep 2007
Posts:
7
Plugin Contributions:
0

Fatal error: Cannot redeclare class soapclient

Running into a problem here, I have just moved my site to a dedicated platform and am getting a problem that didn't exist before, sites comes up fine, however once I try to put something in my cart I get "Fatal error: Cannot redeclare class soapclient" I have read this is a conflict in the soap implementations between php and nusoap (as the problem is from the nusoap.php code - line 7239 (or the end of a bracket)). Not quite shore where the conflict is exactly and how to get rid of it. Any help would be appricated, thanks

Debian 4.0, apache2, php5, dual-core amd.

if you need any other information please ask..

thx

-sean:wacko:

4 Nov 2007, 1:41 PM
#2
drbyte avatar

drbyte

Sensei

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

Re: Fatal error: Cannot redeclare class soapclient

"cannot redeclare class" means that somewhere in your program code that class is being loaded twice.
You'll have to hunt down where it's loaded and stop it from loading a second time.
Perhaps you have duplicate or backup copies of files that are getting automatically loaded ?

https://www.zen-cart.com/tutorials/index.php?article=38
https://www.zen-cart.com/tutorials/index.php?article=39

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

5 Nov 2007, 12:24 AM
#3
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,746
Plugin Contributions:
56

Re: Fatal error: Cannot redeclare class soapclient

Sean, look for an "include" that should be "include_once" or a "require" that should be "require_once."

That Software Guy. My Store: Zen Cart Support
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.

5 Nov 2007, 1:03 AM
#4
srw134 avatar

srw134

New Zenner

Join Date:
Sep 2007
Posts:
7
Plugin Contributions:
0

Re: Fatal error: Cannot redeclare class soapclient

At this point I have chased it down to a buysafe problem, What is weird is that this was not a problem before I moved the server, which was from Fedora 7 to Debian 4, I have sent it to them to find, we will see

-sean

1 Jun 2009, 5:54 PM
#5
ifsca avatar

ifsca

New Zenner

Join Date:
Jun 2008
Posts:
6
Plugin Contributions:
0

Re: Fatal error: Cannot redeclare class soapclient

I don't have a complete answer but the response I received from BuySafe support is below.
The answer is incomplete because two problems were solved and a new one arose. I was now able to successfully authenticate the seal. I was able to see the button in the shopping cart. But when I went to checkout, I got a blank screen. I'll edit this post or reply if I get the rest of the solution. This solution should also work for OsCommerce and other similar carts.

The 3 files can be downloaed from
http://ifscal.net/nusoapPatch/nusoapPatch.zip

Hello,

Here's an explanation of why you are seeing the error:

buySAFE uses the NuSOAP client, which declares 2 classes: 'soap_server'
and 'soapclient'. PHP5 comes with an optional SOAP library (compile with
'--with-soap'), which declares 2 classes: 'SoapServer' and 'SoapClient'.
On machines that have this new PHP library installed, then there exists
a namespace collision. We had to rename references to soapclient to
nusoapclient in our implementation.

To fix this, you will need to download and unzip the file that I have
attached to this message:

Save buysafe.php into \includes\modules\buySAFE\buysafe.php

Save the other two files into both

\includes\classes
\admin\includes\classes