Cannot redeclare class soapclient

From Helpful

"Cannot redeclare class soapclient"

...when you use the NuSOAP[1] library in PHP.

PHP5 also implemented a SOAP client, and called the base class the same thing, so when you use PHP5 with SOAP compiled in, importing NuSOAP will fail.


You can work around this by going into nusoap.php and finding the class definition:

class soapclient extends nusoap_base  {

...and its constructor:

     function soapclient($endpoint, ...

...and changing both these mentions of soapclient into soapclient2 or some other name that doesn't collide. Of course, the actual use of the class will have to use this new name too.