Results 1 to 10 of 10

Thread: enable php soap extension

  1. #1
    Join Date
    Nov 2006
    Posts
    5

    Default enable php soap extension

    I recently transferred to a php5 box since I'll be coding with a lot of SOAP functions. Can someone tell me how to enable the SOAP extension?

    My understanding is that php5 comes with the SOAP extension but that it isn't enabled by default. So I need to modify php.ini to include the extension by adding a line such as:

    extension=php_soap.dll
    or
    extension=php_soap.so

    Simply doing this didn't work however, so perhaps I need to change the directory info where php.ini finds the extension? I'm under the impression I don't need to download this extension myself that it should be there and I just need to enable it. Any help would be greatly appreciated...

  2. #2
    Join Date
    Oct 2006
    Posts
    10

    Default

    I manage to find a post from another forum on the same issue. It seems the PHP5 on the bluehost server need to be recompiled with soap.

    http://www.phpbuilder.com/board/show...php?t=10332838

    Running on window, to use soap, we just need to add "php_soap.dll" file and modify the php.ini. Running on Linux (like Bluehost), to use soap, do we need to add "php_soap.so"? (I am not sure, there is no such file available in my download PHP5 version. And I have tried to search php.net.) But one thing for sure is soap has to be enabled.

    This is what I find when I check my bluehost phpinfo

    PHP Code:
    './configure' '--enable-pic' '--with-libdir=lib64' '--with-config-file-path=.:/usr/local/Zend/etc/' '--prefix=/usr' '--with-xml' '--enable-bcmath' '--enable-calendar' '--with-curl' '--with-dom' '--with-dom-xslt' '--with-dom-exslt' '--enable-exif' '--enable-ftp' '--with-gd' '--with-jpeg-dir=/usr/local' '--with-png-dir=/usr' '--with-xpm-dir=/usr/X11R6' '--with-gettext' '--with-iconv' '--with-imap=/usr/local/imap-2004g' '--enable-mbstring' '--enable-mbstr-enc-trans' '--enable-mbregex' '--with-mcrypt' '--with-mhash' '--enable-magic-quotes' '--with-mysqli' '--with-mysql=/usr' '--with-openssl' '--enable-discard-path' '--with-pdflib' '--with-pear' '--with-pgsql=/usr' '--with-pspell' '--enable-xslt' '--with-xslt-sablot' '--enable-sockets' '--enable-track-vars' '--with-ttf' '--with-freetype-dir=/usr' '--enable-gd-native-ttf' '--with-xsl' '--with-zlib' 
    What is required is below, where soap is being enabled.

    PHP Code:
    ./configure --with-apxs=/usr/local/apache/bin/apxs --prefix=/usr/local --with-xml --enable-bcmath --enable-calendar --with-curl --enable-ftp --with-gd --with-jpeg-dir=/usr/local --with-png-dir=/usr --with-xpm-dir=/usr/X11R6 --enable-magic-quotes --with-mysqli --with-mysql=/usr --enable-discard-path --with-pear --enable-sockets --enable-track-vars --with-zlib --enable-soap 
    I think this is the issue of requesting Bluehost to recompile php with soap. Let me know if I am wrong. Thanks.

    Also, no wonder nobody answer this question, despite being asked for many times.

    I am not sure why people want to use soap. But for me, Commission Junction has started to provide it web services that rely on soap. If it is not being enabled at Bluehost, I think people will keep asking this question, again and again and again and again. Until one day Bluehost realise they do have to enable soap.

    There are quite a number of people has account with Commission Junction, and now trying to use its new web services. Therefore for Bluehost, to enable soap is important.

  3. #3
    Join Date
    Nov 2006
    Posts
    5

    Default

    Yes, you are right, in order to enable SOAP on the BH servers the PHP installation would have to be installed with .configure --enable-soap and the Apache server would have to be restarted.

    As an alternative implementation you could use the NuSOAP library. You just need to download the files and place them in a directory on your server (e.g. lib/) and then put a line in your code like: require_once("../lib/nusoap.php"); and then you can use web services. I find this implementation not as easy to use as the default soap engine that comes with PHP but it works.

    Maybe BH would consider having a PHP5 server with soap enabled for those of us who are keen on using web services?

  4. #4
    Join Date
    Oct 2006
    Posts
    10

    Default

    Hi Black_box,

    thanks, at least there is some progress...
    but now I am having a different kind of problem.

    I put the code below into CJ's productSearch.php code
    PHP Code:
    <?php
        
    require_once("../test/lib/nusoap.php"); 
        
    ?>
    This is the output message:
    Fatal error: Call to undefined method soapclient::search() in /home/username/public_html/test/productSearch.php on line 64
    Line63, 64 and 65 are
    line 63 // call the service with the appropriate variables, remember developer key is required
    line 64 $results = $client->search(
    line 65 $developerKey = '0123456.....xyz'
    What have I done wrong?

    Thank you for your help. Though I do understand bit here and there of programming, I am still very much a learner.

  5. #5
    Join Date
    Nov 2006
    Posts
    5

    Default

    I'm not really sure what the problem is but try assigning your developerKey variable before you call the search function. So switch lines 64 and 65, just a guess...

  6. #6
    Join Date
    Oct 2006
    Posts
    10

    Smile

    thanks. black_box,

    The error message stated that "search(...)" function was not being defined. However, the script works perfectly well on my PC, i.e. "http://localhost/..." (after installing PHP5 and put in appropriate php.ini & php_soap.dll file.).

    I think the more likely cause is that the "search(...)" function was not being defined due to some preceding codes not working properly (which suppose to defined the search(...) function).

    One of the likely place is

    PHP Code:
             // create a soap client using the Commission Junction WSDL
                    
    $ini ini_set("soap.wsdl_cache_enabled","0");
                    
    $client = new SoapClient('productSearchService.wsdl', array('trace'=> true)); 
    this two lines, connect to another file called "productSearchService.wsdl" which is supposed to define the "search(...)" function...I think.

    Otherwise, somehow this "search(...)" function is a pre-defined function available in php_soap.dll and not available in nusoap.

    Will keep trying...
    Last edited by monde; 12-29-2006 at 11:23 PM.

  7. #7
    Join Date
    Oct 2006
    Posts
    10

    Default

    NuSoap has a different way of calling wsdl's operation as compared to SOAP php ext. More codes are need.

    It is time for me to seek professional help.

    Thanks.
    Last edited by monde; 12-29-2006 at 11:59 PM.

  8. #8
    Join Date
    Feb 2007
    Posts
    3

    Default

    Just spoke with support, still no plans on adding the SOAP extension. Count this as another vote to do it.

  9. #9
    Join Date
    Mar 2007
    Posts
    1

    Default

    I just refund

  10. #10

    Thumbs up

    Same here.
    Would love to have this feature enabled.

    Best to you all.

    Francisco

Posting Permissions

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