Настройка Π²ΠΎ врСмя выполнСния

ПовСдСниС Ρ„ΡƒΠ½ΠΊΡ†ΠΈΠΉ зависит ΠΎΡ‚ установок Π² Ρ„Π°ΠΉΠ»Π΅ php.ini.

ΠžΠΏΡ†ΠΈΠΈ настройки SOAP
Имя По ΡƒΠΌΠΎΠ»Ρ‡Π°Π½ΠΈΡŽ ΠœΠ΅ΡΡ‚ΠΎ измСнСния Бписок ΠΈΠ·ΠΌΠ΅Π½Π΅Π½ΠΈΠΉ
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

ΠšΡ€Π°Ρ‚ΠΊΠΎΠ΅ Ρ€Π°Π·ΡŠΡΡΠ½Π΅Π½ΠΈΠ΅ ΠΊΠΎΠ½Ρ„ΠΈΠ³ΡƒΡ€Π°Ρ†ΠΈΠΎΠ½Π½Ρ‹Ρ… Π΄ΠΈΡ€Π΅ΠΊΡ‚ΠΈΠ².

soap.wsdl_cache_enabled int

Π’ΠΊΠ»ΡŽΡ‡Π°Π΅Ρ‚ ΠΈΠ»ΠΈ ΠΎΡ‚ΠΊΠ»ΡŽΡ‡Π°Π΅Ρ‚ ΠΊΠ΅ΡˆΠΈΡ€ΠΎΠ²Π°Π½ΠΈΠ΅ WSDL.

soap.wsdl_cache_dir string

УстанавливаСт ΠΏΡƒΡ‚ΡŒ ΠΊ Π΄ΠΈΡ€Π΅ΠΊΡ‚ΠΎΡ€ΠΈΠΈ, Π³Π΄Π΅ ΠΌΠΎΠ΄ΡƒΠ»ΡŒ SOAP Π±ΡƒΠ΄Π΅Ρ‚ Ρ…Ρ€Π°Π½ΠΈΡ‚ΡŒ кСш-Ρ„Π°ΠΉΠ»Ρ‹.

soap.wsdl_cache_ttl int

УстанавливаСт количСство сСкунд (врСмя ΠΆΠΈΠ·Π½ΠΈ) для Ρ„Π°ΠΉΠ»ΠΎΠ² Π² кСшС, ΠΊΠΎΡ‚ΠΎΡ€ΠΎΠ΅ ΠΎΠ½ΠΈ Π±ΡƒΠ΄ΡƒΡ‚ ΠΈΡΠΏΠΎΠ»ΡŒΠ·ΠΎΠ²Π°Ρ‚ΡŒΡΡ вмСсто ΠΎΡ€ΠΈΠ³ΠΈΠ½Π°Π»ΡŒΠ½Ρ‹Ρ… Ρ„Π°ΠΉΠ»ΠΎΠ².

soap.wsdl_cache int

Если ΠΏΠ°Ρ€Π°ΠΌΠ΅Ρ‚Ρ€ soap.wsdl_cache_enabled ΠΏΡ€ΠΈΠ½ΠΈΠΌΠ°Π΅Ρ‚ Π·Π½Π°Ρ‡Π΅Π½ΠΈΠ΅ "on", Ρ‚ΠΎ эта опция опрСдСляСт Ρ‚ΠΈΠΏ ΠΊΠ΅ΡˆΠΈΡ€ΠΎΠ²Π°Π½ΠΈΡ. Он ΠΌΠΎΠΆΠ΅Ρ‚ Π±Ρ‹Ρ‚ΡŒ Π»ΡŽΠ±Ρ‹ΠΌ ΠΈΠ· ΡΠ»Π΅Π΄ΡƒΡŽΡ‰ΠΈΡ… Ρ‚ΠΈΠΏΠΎΠ²: WSDL_CACHE_NONE (0), WSDL_CACHE_DISK (1), WSDL_CACHE_MEMORY (2) ΠΈΠ»ΠΈ WSDL_CACHE_BOTH (3). Π­Ρ‚ΠΎ Ρ‚Π°ΠΊΠΆΠ΅ ΠΌΠΎΠΆΠ΅Ρ‚ Π±Ρ‹Ρ‚ΡŒ установлСно Ρ‡Π΅Ρ€Π΅Π· массив options Π² конструкторС SoapClient ΠΈΠ»ΠΈ SoapServer.

soap.wsdl_cache_limit int

МаксимальноС количСство находящихся Π² ΠΎΠΏΠ΅Ρ€Π°Ρ‚ΠΈΠ²Π½ΠΎΠΉ памяти ΠΊΠ΅ΡˆΠΈΡ€ΠΎΠ²Π°Π½Π½Ρ‹Ρ… Ρ„Π°ΠΉΠ»ΠΎΠ² WSDL. Π”Π°Π»ΡŒΠ½Π΅ΠΉΡˆΠ΅Π΅ Π΄ΠΎΠ±Π°Π²Π»Π΅Π½ΠΈΠ΅ Ρ„Π°ΠΉΠ»ΠΎΠ² Π² Π·Π°ΠΏΠΎΠ»Π½Π΅Π½Π½ΡƒΡŽ кСш-ΠΏΠ°ΠΌΡΡ‚ΡŒ Π±ΡƒΠ΄Π΅Ρ‚ ΠΏΡ€ΠΈΠ²ΠΎΠ΄ΠΈΡ‚ΡŒ ΠΊ ΡƒΠ΄Π°Π»Π΅Π½ΠΈΡŽ ΠΈΠ· Π½Π΅Ρ‘ самых старых Ρ„Π°ΠΉΠ»ΠΎΠ².

οΌ‹Π”ΠΎΠ±Π°Π²ΠΈΡ‚ΡŒ

ΠŸΡ€ΠΈΠΌΠ΅Ρ‡Π°Π½ΠΈΡ ΠΏΠΎΠ»ΡŒΠ·ΠΎΠ²Π°Ρ‚Π΅Π»Π΅ΠΉ 4 notes

up
9
michal-ok at o2 dot pl ΒΆ
6 years ago
Be aware that wsdl cache may not be compatible across different PHP versions, which may be important to know when you upgrade your PHP on the same system or use a multi-PHP version setup where you run the same scripts from different PHP versions. In other words, when a SOAP request writes a file to the cache and then you make another SOAP request from another PHP version and this cache file is used then *sometimes* you may experience unexpected errors that you will not know where they come from.

I spent hours trying to figure out why I was getting "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 version 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 versions with wsdl cache then you'd need to set wsdl_cache_dir that is different for each PHP version.
up
12
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 clients as well) :

1. default_socket_timeout default 60 secs
Large or slow requests to your soap server or long processes at your soap server will return soap fault after 60 secs like : Error Fetching http headers.

2. max_execution_time default 30 secs
This can be the next bottleneck (but only when your default_socket_timeout is larger then this setting). Your soap server will not return anything, no faults 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 processes puts memory usage over this limit.

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

max_input_time
max_input_nesting_level
max_input_vars
post_max_size
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
up
11
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). 
Changing the settings like above does not have any effect on already existing soap-objects.

[EDIT BY danbrown AT php DOT net: Typofix provided by (james AT voodoo DOT co DOT uk) on 4-FEB-09.]
up
-3
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).