soap擴充編譯,載入及動態載入

來源:互聯網
上載者:User
#soap擴充

編譯soap.so擴充~

SOAP擴充

進入安裝原php的源碼目錄,

cd ext

cd soap

phpize

./configure --with-php-config=/var/php/bin/php-config (一定要有php-config這個檔案的路徑,不然會報錯!)

make

就會在PHPDIR/ext/soap/modules/下產生soap.so的檔案

php -i | grep ini 找到php.ini file

vi 那個php.ini

找到extension_dir = "/usr/lib/php/extensions"

將編譯的soap.so放到裡面

添加php.ini

extension=soap.so

[soap]

; Enables or disables WSDL caching feature.

soap.wsdl_cache_enabled=1

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

soap.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

查看php -i | 是否安裝成功

重啟web服務

service nginx restart

service php-fpm stop

service php-fpm start

#可惜由於影響到先有程式...只能動態載入擴充

程式動態載入模組

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

其他常用擴充函數

extension_loaded('soap')//是否載入了soap擴充

dl('soap.so');//載入soap擴充

ini_set('soap.wsdl_cache_dir',"/tmp");//設定擴充參數

array get_extension_funcs ( string $module_name )

array get_loaded_extensions ([ bool $zend_extensions= false ] )

  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.