Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Fatal error: Cannot redeclare class soapclient


mark46818

Recommended Posts

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

Link to comment
Share on other sites

in /includes/classes/

YOu have another php file that is renamed but is there.

 

Either modify that files extension or delete.

 

Satish

Ask/Skype for Free osCommerce value addon/SEO suggestion tips for your site.

 

Check My About US For who am I and what My company does.

Link to comment
Share on other sites

  • 2 weeks later...
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

Link to comment
Share on other sites

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

 

Satish

Ask/Skype for Free osCommerce value addon/SEO suggestion tips for your site.

 

Check My About US For who am I and what My company does.

Link to comment
Share on other sites

  • 3 weeks later...
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..

It's not a beer gut, it's padding for my rock hard abs!

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Ask/Skype for Free osCommerce value addon/SEO suggestion tips for your site.

 

Check My About US For who am I and what My company does.

Link to comment
Share on other sites

  • 2 weeks later...

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

Link to comment
Share on other sites

  • 2 weeks later...

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.

Link to comment
Share on other sites

  • 2 weeks later...
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?

Edited by masscraft
Link to comment
Share on other sites

  • 1 month later...
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.

/*        $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);

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...