OSCOMMERCE SUPPORT CALL 702-453-3332

 

Help - Search - Members - Calendar
Full Version: Fatal error: Cannot redeclare class soapclient
osCommerce Community Support Forums > osCommerce Online Merchant v2.x > Contributions / Add-Ons > Payment Modules > PayPal
mark46818
I am trying to build my store and being a complete newbie and having little to no experience with html or programming of any sort, I have been very careful and conservative in what I have done so far. Everything was working fine until last night when I installed the pay pal mod. I tried to enter a sample order to make sure everything was working, as soon as I clicked add to cart I received this error message;

Fatal error: Cannot redeclare class soapclient in /home/mamasue1/public_html/includes/classes/nusoap.php on line 7239

I tried removing the Paypal mod and it did not change.

I need some help BIG TIME.

Thanks in advance
burt
redeclare - that's the word that tells you the problem.

You have already declared the class called "soapclient", so you cannot declare it again in nusoap.php

So, look for "soapclient" in all the files and folders until you track down where you have already declared it. Once you find it, remove it.
satish
in /includes/classes/
YOu have another php file that is renamed but is there.

Either modify that files extension or delete.

Satish
chellliepsp
QUOTE (satish @ Feb 21 2008, 03:48 PM) *
in /includes/classes/
YOu have another php file that is renamed but is there.

Either modify that files extension or delete.

Satish


Maybe Ive just been on here too long today, but I just do not understand how to fix this. Layman's terms please...the long version. I sure appreciate any help.

Michelle
satish
if two class file named different but having the same class then this might happen.

Satish
Allensbayou
QUOTE (chellliepsp @ Mar 3 2008, 09:00 AM) *
Maybe Ive just been on here too long today, but I just do not understand how to fix this. Layman's terms please...the long version. I sure appreciate any help.

Michelle

Hello,
Have you found a solution to this?
I have the same problem after moving to a new host..
It was working and then yesterday, not..
rfibanez
QUOTE (Allensbayou @ Mar 22 2008, 08:26 PM) *
Hello,
Have you found a solution to this?
I have the same problem after moving to a new host..
It was working and then yesterday, not..


I couldn't figure out how to fix this as I had the same problem...I did find out this has something to do with buysafe so I removed buysafe and now my store is working again.
satish
The basic concept of osc is.

That it reads all the files that are in the folder.

So if there are two files defining the same class(same class name) then this is going to happen.

Satish
redneckchick621
Hopefully, you guys have found a solution. My only recourse was to reinstall OSCommerce and the paypal module. Since I hadnt uploaded any products yet, it was easily done. I did not understand what "class" meant, so I did it the hard way. If you guys know, and maybe Satish should do this if he has time, post what "class" and "soapclient" means and maybe where to find it. It sure would help us newbies.

Thanks Satish, you've been a great help to me in getting my store going. Hugs!!

Michelle
bw92116
If your server is running PHP5, the "cannot redeclare soapdirect" error may be caused by a conflict between nusoap.php and PHP5.

"soapclient" is declared in PHP5 and is also declared in nusoap.php. The way I fixed it was by downloading an updated version of nusoap.php, from this page:

http://sourceforge.net/project/showfiles.php?group_id=57663

You'll get a bunch of files in this download. The only one of them I used was nusoap.php. In your catalog/includes/classes, replace the file nusoap.php with the one downloaded from the page above. That should clear up the problem, if it was caused by the known conflict between PHP5 and nusoap.
masscraft
QUOTE (bw92116 @ Apr 18 2008, 10:29 AM) *
If your server is running PHP5, the "cannot redeclare soapdirect" error may be caused by a conflict between nusoap.php and PHP5.

"soapclient" is declared in PHP5 and is also declared in nusoap.php. The way I fixed it was by downloading an updated version of nusoap.php, from this page:

http://sourceforge.net/project/showfiles.php?group_id=57663

You'll get a bunch of files in this download. The only one of them I used was nusoap.php. In your catalog/includes/classes, replace the file nusoap.php with the one downloaded from the page above. That should clear up the problem, if it was caused by the known conflict between PHP5 and nusoap.


When I replace the nusoap.php file, making no other changes, I get the following errors when I click to add an item to the shopping cart:

Warning: SoapClient::__construct() expects at most 2 parameters, 8 given in /home/diamond9/public_html/includes/modules/addons/buysafe.php on line 59

Fatal error: Uncaught SoapFault exception: [Client] SoapClient::__construct() [function.--construct]: Invalid parameters in /home/diamond9/public_html/includes/modules/addons/buysafe.php:59 Stack trace: #0 /home/diamond9/public_html/includes/modules/addons/buysafe.php(59): SoapClient->__construct('https://api.buy...', false, false, false, false, false, 5, 5) #1 /home/diamond9/public_html/includes/classes/buysafe.php(43): buysafe->call_api('AddUpdateShoppi...', Array) #2 /home/diamond9/public_html/includes/runtime/applicationtop/buysafe_applicationtop_bottom.php(31): buysafe_class->call_api('AddUpdateShoppi...', Array) #3 /home/diamond9/public_html/includes/classes/rci.php(45): include('/home/diamond9/...') #4 /home/diamond9/public_html/includes/application_top.php(739): cre_RCI->get('applicationtop', 'bottom', false) #5 /home/diamond9/public_html/shopping_cart.php(15): require('/home/diamond9/...') #6 {main} thrown in /home/diamond9/public_html/includes/modules/addons/buysafe.php on line 59

Any thoughts?
ermanno
QUOTE (masscraft @ Apr 27 2008, 06:12 PM) *
When I replace the nusoap.php file, making no other changes, I get the following errors when I click to add an item to the shopping cart:

Warning: SoapClient::__construct() expects at most 2 parameters, 8 given in /home/diamond9/public_html/includes/modules/addons/buysafe.php on line 59

Fatal error: Uncaught SoapFault exception: [Client] SoapClient::__construct() [function.--construct]: Invalid parameters in /home/diamond9/public_html/includes/modules/addons/buysafe.php:59 Stack trace: #0 /home/diamond9/public_html/includes/modules/addons/buysafe.php(59): SoapClient->__construct('https://api.buy...', false, false, false, false, false, 5, 5) #1 /home/diamond9/public_html/includes/classes/buysafe.php(43): buysafe->call_api('AddUpdateShoppi...', Array) #2 /home/diamond9/public_html/includes/runtime/applicationtop/buysafe_applicationtop_bottom.php(31): buysafe_class->call_api('AddUpdateShoppi...', Array) #3 /home/diamond9/public_html/includes/classes/rci.php(45): include('/home/diamond9/...') #4 /home/diamond9/public_html/includes/application_top.php(739): cre_RCI->get('applicationtop', 'bottom', false) #5 /home/diamond9/public_html/shopping_cart.php(15): require('/home/diamond9/...') #6 {main} thrown in /home/diamond9/public_html/includes/modules/addons/buysafe.php on line 59

Any thoughts?


Step 1: Place all nusoap-0.7.3\lib php into classes folder,
Step 2: In buysafe.php, I have changed soapclient as nusoap_client then solved my similar case. You may reference it.
CODE
/* $soapclient = new soapclient(MODULE_BUYSAFE_BUYSAFE_API_URL, false, false, false, false, false, 5, 5);
*/
$soapclient = new nusoap_client(MODULE_BUYSAFE_BUYSAFE_API_URL, false, false, false, false, false, 5, 5);

This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.