歡迎您光臨本站 註冊首頁

PECL 與 phpize

←手機掃碼閱讀     火星人 @ 2014-03-08 , reply:0

PECL 的全稱是 The PHP Extension Community Library ,是一個開放的並通過 PEAR(PHP Extension and Application Repository,PHP 擴展和應用倉庫)打包格式來打包安裝的 PHP 擴展庫倉庫.

phpize 命令是用來準備 PHP 擴展庫的編譯環境的,有了這個工具不必為了一個想要的模塊,而重新編譯php了!

例子:為php增加openssl.so模塊

1 使用 phpize

  1. cd php-5.2.6/ext/openssl/
  2. /usr/local/php/bin/phpize Configuring for: PHP Api Version: 20041225 Zend Module Api No: 20060613 Zend Extension Api No: 220060519
  3. ./configure --with-openssl --with-php-config=/usr/local/php/bin/php-config
  4. make && make install
  5. installing shared extensions: /usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/

2 得到openssl.so 文件

  1. file /usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/openssl.so
  2. /usr/.省略./openssl.so: ELF 64-bit LSB shared object, AMD x86-64, version 1 (SYSV), not stripped

3 編輯php.in配置文檔

  1. 在php.ini內加入以下內容:
  2. extension_dir
    = "/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/"
  3. extension = "openssl.so"

4 重啟apache

  1. /usr/local/apache/bin/apachectl restart

5 驗證

  1. # /usr/local/php/bin/php -m | grep 'openssl'
  2. openssl

參考

http://www.php.net/manual/zh/install.pecl.intro.php

http://www.ibm.com/developerworks/cn/opensource/os-cn-php-pecl/index.html

結束

本文出自 「dongnan」 博客,請務必保留此出處http://dngood.blog.51cto.com/446195/813607


[火星人 ] PECL 與 phpize已經有235次圍觀

http://coctec.com/docs/linux/show-post-45978.html