PECL 的全稱是 The PHP Extension Community Library ,是一個開放的並經過 PEAR(PHP Extension and Application Repository,PHP 擴展和應用倉庫)打包格式來打包安裝的 PHP 擴展庫倉庫。php
phpize 命令是用來準備 PHP 擴展庫的編譯環境的,有了這個工具沒必要爲了一個想要的模塊,而從新編譯php了!html
例子:爲php增長openssl.so模塊mysql
1 使用 phpizesql
- cd php-5.2.6/ext/openssl/
- /usr/local/php/bin/phpize
Configuring for:
PHP Api Version: 20041225
Zend Module Api No: 20060613
Zend Extension Api No: 220060519
- ./configure --with-openssl --with-php-config=/usr/local/php/bin/php-config
- make && make install
- installing shared extensions: /usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/
2 獲得openssl.so 文件apache
- file /usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/openssl.so
- /usr/.省略./openssl.so: ELF 64-bit LSB shared object, AMD x86-64, version 1 (SYSV), not stripped
3 編輯php.in配置文檔ide
- 在php.ini內加入如下內容:
- extension_dir = "/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/"
- extension = "openssl.so"
4 重啓apache工具
- /usr/local/apache/bin/apachectl restart
5 驗證spa
- # /usr/local/php/bin/php -m | grep 'openssl'
- openssl
#update 20130216 pdo-mysql.net
- ./configure --with-pdo-mysql=/usr/local/mysql/ --with-php-config=/usr/local/php/bin/php-config
參考debug
http://www.php.net/manual/zh/install.pecl.intro.php
http://www.ibm.com/developerworks/cn/opensource/os-cn-php-pecl/index.html
結束