Installation


Installing PHP5's SOAP module is rather easy. Users of the Windows distribution find it in the ext directory of PHP and can use the following php.ini statement to load it:

 extension=php_soap.dll 

The module also requires the libxml library (http://www.xmlsoft.org/); however, this is included by default in PHP 5, at least under Windows.

Under Unix/Linux/Mac, libxml has to be installed, at least in version 2.5.4 (however, at the time of writing, version 2.6.11 is current and is included in the Windows binaries of PHP 5.0.1). Also, PHP must be configured using the configuration switch --enable-soap.

As usual, calling phpinfo() shows whether the installation succeeded. Figure 18.2 shows the successa soap enTRy is in the module list.

Figure 18.2. Success: The SOAP module has been loaded.


The SOAP module can cache WSDL descriptions, which makes the repetitive use of the SOAP functions much more performant. The php.ini options in Table 18.1 fine-tune this behavior:

Table 18.1. Available Configuration Options for the SOAP Module

Option

Description

Default Value

soap.wsdl_cache_dir

Directory for cached WSDL files (write privileges required)

"/tmp"

 soap.wsdl_cache_enabled soap.wsdl_cache_ttl 

Whether caching is enabled "Time to live" for cached WSDL document, in seconds

"1" (means: On)

86400 (that is, one day)


TIP

For testing purposes, you should always disable WSDL caching during development; otherwise, outdated WSDL information might lead to unexplainable errors. You can set this behavior on a per-script basis, using ini_set():

 ini_set('soap.wsdl_cache_enabled', 'Off'); 




PHP 5 Unleashed
PHP 5 Unleashed
ISBN: 067232511X
EAN: 2147483647
Year: 2004
Pages: 257

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net