출처 : http://openx3.tistory.com/24
1. PEAR 설치
pear 를 설치하자
$ sudo apt-get install php-pear
설치후 pear channel 업데이트를 통해 channel 정보를 최신으로 하자
$ sudo pear channel-update pear.php.net
2. oauth 설치 : 에러 #1
php-pear 설치후 다음과 같이 pecl 확장 설치 명령을 내리면 make 에러가 난다
$ sudo pecl install oauth
….
checking whether to build static libraries… no
configure: creating ./config.status
config.status: creating config.h
config.status: executing libtool commands
running: make
sh: make: not found
2-1. make 에러 fix : make 설치
에러 메세지를 보면 알겠지만 기본 상태의 ubuntu 설치에 make 가 없다 make 를 설치하자.
$ sudo apt-get install make
3. PEAR 설치 : 에러 #2
$ sudo pecl install oauth
이 과정에서 다음과 같은 에러가 발생할 수 있다.
/usr/include/php5/ext/pcre/php_pcre.h:29: fatal error: pcre.h:
3.1 pcre 에러 fix : pcre
다음과 같이 pcre 라이브러리를 설치하자
$ sudo apt-get install libpcre3-dev
내가 겪은 두 개의 에러는 모두 잡힌것 같다. 정말로 설치를 해보자.
$ sudo pecl install oauth
…
Build process completed successfully
Installing ‘/usr/lib/php5/20090626+lfs/oauth.so’
install ok: channel://pecl.php.net/oauth-1.1.0
configuration option “php_ini” is not set to php.ini location
You should add “extension=oauth.so” to php.ini
5. 설정
마지막 줄을 보면 php.ini 파일 내에 extension 설정을 해줘야 한다는 문구가 나온다 php.ini를 찾아 집어 넣어보자.
apt로 php 를 설치한 경우 php.ini는 /etc/php5/apache2/ 디렉토리에 있다.
;;;;;;;;;;;;;;;;;;;;
; PEAR Extentsions ;
;;;;;;;;;;;;;;;;;;;;
extension=oauth.so
위와 같이 php.ini를 수정하였으면 웹 서버를 재기동하자.
$ sudo service apache2 restart
6. 테스트
설치가 잘 되었나 확인해보기 위해 다음과 같은 테스트 파일을 만들어 확인해 보자.
<?php
$oauth = new OAuth(“사용자 Consumer Key”, “사용자 Consumer Secret”, OAUTH_SIG_METHOD_RSASHA1, OAUTH_AUTH_TYPE_URI);
if($oauth) {
echo “OAuth is enabled”;
}
?>

One Reply to “ubuntu에서 PECL OAuth 설치”