php 확장모듈 설치 (pecl)
pecl(PHP Extension Community Library)은 C로 만들어진, php에 기능을 추가하기 위한 확장 모듈 library
생성된 모듈을 php.ini 파일에 추가해서 load 한다.
1. 설치되어 있는 php 확장 모듈 확인
[root@localhost bin]# cd /usr/local/php/bin
[root@localhost bin]# ./pecl list
Installed packages, channel pecl.php.net:
=========================================
Package Version State
imagick 3.0.1 stable
[root@localhost bin]#
2. pecl 확장 모듈 설치
[root@localhost bin]# ./pecl install hash
downloading hash-1.5.tgz …
Starting to download hash-1.5.tgz (98,809 bytes)
………………….done: 98,809 bytes
30 source files, building
WARNING: php_bin /usr/local/php/bin/php appears to have a suffix /bin/php, but config variable php_suffix does not match
running: phpize
Configuring for:
PHP Api Version: 20041225
Zend Module Api No: 20060613
Zend Extension Api No: 220060519
building in /var/tmp/pear-build-root/hash-1.5
running: /tmp/pear/temp/hash/configure
checking for egrep… grep -E
checking for a sed that does not truncate output… /bin/sed
checking for cc… cc
checking for C compiler default output file name… a.out
~
Build process completed successfully
Installing ‘/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/hash.so’
Installing ‘/usr/local/php/include/php/ext/hash/php_hash_snefru.h’
Installing ‘/usr/local/php/include/php/ext/hash/php_hash_sha.h’
Installing ‘/usr/local/php/include/php/ext/hash/php_hash.h’
Installing ‘/usr/local/php/include/php/ext/hash/php_hash_haval.h’
Installing ‘/usr/local/php/include/php/ext/hash/php_hash_tiger.h’
Installing ‘/usr/local/php/include/php/ext/hash/php_hash_crc32.h’
Installing ‘/usr/local/php/include/php/ext/hash/php_hash_ripemd.h’
Installing ‘/usr/local/php/include/php/ext/hash/php_hash_adler32.h’
Installing ‘/usr/local/php/include/php/ext/hash/php_hash_md.h’
Installing ‘/usr/local/php/include/php/ext/hash/php_hash_types.h’
Installing ‘/usr/local/php/include/php/ext/hash/php_hash_gost.h’
Installing ‘/usr/local/php/include/php/ext/hash/php_hash_whirlpool.h’
install ok: channel://pecl.php.net/hash-1.5
configuration option “php_ini” is not set to php.ini location
You should add “extension=hash.so” to php.ini
[root@localhost bin]#
[root@localhost bin]# cd /usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/
[root@localhost no-debug-non-zts-20060613]# ls
hash.so imagick.so
[root@localhost no-debug-non-zts-20060613]#
– php.ini 파일에 extension_dir 부분에 .so 파일이 위치한 경로를 입력하고 extension=hash.so 부분을 추가 후 apache를 리스타트 한다.
extension_dir = “/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613”
extension=imagick.so
extension=hash.so
3. 설치 가능한 확장 모듈 리스트 출력
[root@localhost bin]# ./pecl list-all
All packages [Channel pecl.php.net]:
====================================
Package Latest Local
pecl/KTaglib 0.2.0 Library to edit audio properties and tags on MPEG and OGG files
pecl/FliteTTS Text to speech voice synthesis for PHP
pecl/radius 1.2.5 Radius client library
pecl/sasl 0.1.0 Cyrus SASL Extension
pecl/PAM 1.0.3 PAM integration
pecl/courierauth 0.1.0 courierauth binding
pecl/krb5 Kerberos authentication and management
pecl/DTrace 1.0.3 A Solaris Dtrace provider
pecl/inclued 0.1.3 Clued-in about your inclueds
pecl/zookeeper 0.2.1 PHP extension for interfacing with Apache ZooKeeper
pecl/augeas 0.6.1 PHP bindings to the Augeas API
pecl/xmms 0.2 Provides functions to interact with xmms
pecl/newt 1.2.6 Extension for RedHat Newt window library
pecl/tvision 0.1 Turbo Vision wrapper
~
[root@localhost bin]#