Home > Backend Development > PHP Tutorial > soap extension compilation, loading and dynamic loading

soap extension compilation, loading and dynamic loading

巴扎黑
Release: 2023-03-01 11:00:01
Original
1446 people have browsed it

#soap extension

Compile soap.so extension~

SOAP extension

Enter the source code directory where the original php is installed,

cd ext

cd soap

phpize

./configure --with-php-config= /var/php/bin/php-config (There must be the path to the php-config file, otherwise an error will be reported!)

make

will generate the soap.so file under PHPDIR/ext/soap/modules/

php -i | grep ini Find the php.ini file

vi that php.ini

Find extension_dir = "/usr/lib/php/extensions"

Put the compiled soap.so in it

Add php .ini

extension=soap.so

[soap]

;Enables or disables WSDL caching feature.

soap.wsdl_cache_enabled=1

; wsdl_cache_dir="/tmp"

; (time to live) Sets the number of second while cached file will be used

; instead of original one.

soap.wsdl_cache_ttl=86400

Check whether the installation is successful with php -i |

Restart the web service

service nginx restart

service php-fpm stop

service php-fpm start

#Unfortunately, due to the impact on the existing program...only the extension can be loaded dynamically

The program dynamically loads the module

if (!extension_loaded('soap')) {  
    if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {  
        dl('soap.dll');  
        ini_set('soap.wsdl_cache_dir',"C:\WINDOWS\Temp");  
    } else {  
        dl('soap.so');  
        ini_set('soap.wsdl_cache_dir',"/tmp");  
    }  
    ini_set('soap.wsdl_cache_enabled','1');  
    ini_set('soap.wsdl_cache_ttl',86400);  
}
Copy after login

Other commonly used extension functions

extension_loaded('soap')//Whether the soap extension is loaded

dl('soap.so');//Loading the soap extension

ini_set('soap.wsdl_cache_dir',"/tmp" );//Set extension parameters

array get_extension_funcs ( string $module_name )

array get_loaded_extensions ([ bool $zend_extensions= false ] )

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template