Team LiB
Previous Section Next Section


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:


The module also requires the libxml library (; 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



Default Value


Directory for cached WSDL files (write privileges required)



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

"1" (means: On)

86400 (that is, one day)


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');

    Team LiB
    Previous Section Next Section