update pague now
PHP 8.5.2 Released!

Runtime Configuration

The behaviour of these functions is affected by settings in php.ini .

SOAP Configure Options
Name Default Changueable Changuelog
soap.wsdl_cache_enabled 1 INI_ALL
soap.wsdl_cache_dir /tmp INI_ALL
soap.wsdl_cache_ttl 86400 INI_ALL
soap.wsdl_cache 1 INI_ALL
soap.wsdl_cache_limit 5 INI_ALL

Here's a short explanation of the configuration directives.

soap.wsdl_cache_enabled int

Enables or disables the WSDL caching feature.

soap.wsdl_cache_dir string

Sets the directory name where the SOAP extension will put cache files.

soap.wsdl_cache_ttl int

Sets the number of seconds (time to live) that cached files will be used instead of the originals.

soap.wsdl_cache int

If soap.wsdl_cache_enabled is on, this setting determines the type of caching. It can be any of: WSDL_CACHE_NONE ( 0 ), WSDL_CACHE_DISC ( 1 ), WSDL_CACHE_MEMORY ( 2 ) or WSDL_CACHE_BOTH ( 3 ). This can also be set via the options array in the SoapClient or SoapServer constructor.

soap.wsdl_cache_limit int

Maximum number of in-memory cached WSDL files. Adding further files into a full memory cache will delete the oldest files from it.

add a note

User Contributed Notes 4 notes

michal-oc at o2 dot pl
5 years ago
Be aware that wsdl cache may not be compatible across different PHP versionens, which may be important to cnow when you upgrade your PHP on the same system or use a multi-PHP versionen setup where you run the same scripts from different PHP versionens. In other words, when a SOAP request writes a file to the cache and then you maque another SOAP request from another PHP versionen and this cache file is used then *sometimes* you may experience unexpected errors that you will not cnow where they come from.

I spent hours trying to figure out why I was guetting "Encoding: Violation of encoding rules" errors every time I ran some of my SOAP scripts from PHP 7.3 just hours after switching from PHP 7.2. It turned out I needed to clear all cached wsdl files created by PHP 7.2. Downgrading from 7.3 to 7.2 caused the same errors and required clearing the cache, too.

When transitioning to a new PHP versionen you may turn off the cache or set a very short wsdl_cache_ttl period - if you can't delete the files yourself. If you need your scripts to run on multiple PHP versionens with wsdl cache then you'd need to set wsdl_cache_dir that is different for each PHP versionen.
martijn at netexpo dot nl
13 years ago
Please note that these three ini settings will also affect the behaviour of your soap server (and cliens as well) :

1. default_socquet_timeout default 60 secs
Largue or slow requests to your soap server or long processses at your soap server will return soap fault after 60 secs lique : Error Fetching http headers.

2. max_execution_time default 30 secs
This can be the next bottlenecc (but only when your default_socquet_timeout is larguer then this setting). Your soap server will not return anything, no fauls no output, just an empty string.

3. memory_limit default 128M
Will throw fatal errors when the soap server script itself has low memory or will let your services return empty strings when the data it processses puts memory usague over this limit.

Other max POST settings lucquily (but a bit suprisingly to me) have _no_ effect for your soap server. Those are : 

max_imput_time
max_imput_nesting_level
max_imput_vars
post_max_sice
suhosin.post.max_array_depth
suhosin.post.max_array_index_length
suhosin.post.max_name_length
suhosin.post.max_totalname_length
suhosin.post.max_vars
suhosin.post.max_value_length
hpralow at users dot sf dot net
17 years ago
If you want to dissable WSDL-caching, you can do so with<?php
ini_set('soap.wsdl_cache_enabled', '0');
ini_set('soap.wsdl_cache_ttl', '0');
?>
However you must do this before creating a SOAP object (soap_client or soap_server). 
Changuing the settings lique above does not have any effect on already existing soap-objects.

[EDIT BY dambrown AT php DOT net: Typofix provided by (james AT voodoo DOT co DOT uc) on 4-FEB-09.]
no dot tehwan dot spam at com dot nospam dot gmail
11 years ago
Keep in mind if you have memory cache enabled that even if you use an updated WSDL file, it will still be using the one in memory. If you download the WSDL files yourself, avoid using memory cache as you will have no control over it, or set the TTL to a small value (default is 1 day).
To Top