Welcome to the JaguarPC Community
JaguarPC
Sales: (888) 338-5261
Support: (888)-551-3050
Results 1 to 5 of 5

This is a discussion on php soap error in the Design and Development forum
Hi every body this is my php info : phpinfo() and in my website i have this error : Fatal error: Cannot redeclare class soapclient ...

  1. #1
    take it easy ... arianetwork's Avatar
    Join Date
    Mar 2006
    Location
    Hungry
    Posts
    107

    php soap error

    Hi every body
    this is my php info :
    phpinfo()
    and in my website i have this error :

    Fatal error: Cannot redeclare class soapclient in /home/ariashop/public_html/lib/nusoap.php on line 0

    how should i config server to solve this issue ?
    of course it works on other server fine

  2. #2
    JPC Dream Team JPC-Sabrina's Avatar
    Join Date
    Aug 2011
    Posts
    336
    What version are you running?
    JPC-Sabrina / Public Relations
    sabrina@jaguarpc.com

    Sabrina/ Public Relations
    (email)

    Need a Manager?
    (pm) | (email) David, Customer Service Manager
    (pm) | (email) Masood, Chief Technical Officer
    (pm) | (email) Les, Chief Operations Officer

  3. #3
    Community Leader jason's Avatar
    Join Date
    Sep 2001
    Location
    Rochester, NY
    Posts
    6,003
    PHP 5 has a built-in SOAP client that is also called soapclient (actually SoapClient, but PHP doesn't care about the case). So when you try to use nuSOAP on a PHP 5.x site, you will get the error you describe. What's happening is that your code is trying to declare a class that has the same name as the built-in one, causing a conflict.

    The only solution, to my knowledge, is to rename the soapclient class in nusoap.php. Open up that file and look for a line that looks something like

    PHP Code:
    class soapclient 
    (Note: there may be more between "soapclient" and the "{.") Then change soapclient to something like nusoapclient.

    You you'll also have to change all of your code that references that class to use the new class name. This can be quite a pain if you are using a third-party application. If you're writing your own code from scratch, I'd recommend using the PHP-native SOAP libraries instead of nuSOAP. You can find the docs at PHP: SOAP - Manual.

    --Jason
    Jason Pitoniak
    Interbrite Communications
    www.interbrite.com www.kodiakskorner.com

  4. #4
    Loyal Client the_ancient's Avatar
    Join Date
    Feb 2004
    Posts
    3,384
    -------------------------
    the_ancient
    MP Technology Group

  5. #5
    JPC Member martin86's Avatar
    Join Date
    Jan 2012
    Posts
    6
    The problem is that the class SoapClient was added into PHP5. The quickfix that I made and works is changing in nusoap.php, "soapclient" to "soapclient2" in the class and constructor lines and then changing all instances of "new soapclient" to "new soapclient2" in index.php,CustomerAuthenticate.php,gener al.php and UserTickets.php.

    Does anyone know where I can submit this bug?

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •