"CentOS APC 설치"의 두 판 사이의 차이

4번째 줄: 4번째 줄:
pecl install로 설치할 예정인데, 정상적으로 설치하기 위해서는 pecl, gcc, phpize, make 명령어를 사용할 수 있는 환경이 되어야 한다.
pecl install로 설치할 예정인데, 정상적으로 설치하기 위해서는 pecl, gcc, phpize, make 명령어를 사용할 수 있는 환경이 되어야 한다.


*[[pecl 설치]] (설치여부는 명령어 pecl로 확인)
*[[pecl 설치]] (설치여부는 명령어 <code>pecl version</code>로 확인)
*[[gcc 설치]] (설치여부는 명령어 gcc로 확인)
*[[gcc 설치]] (설치여부는 명령어 gcc로 확인)
*[[php-devel 설치]] (설치여부는 명령어 phpize로 확인)
*[[php-devel 설치]] (설치여부는 명령어 phpize로 확인)
11번째 줄: 11번째 줄:
;설치확인
;설치확인
<source lang='dos'>
<source lang='dos'>
[root@jmnote ~]# pecl
[root@jmnote ~]# pecl version
... (생략)
PEAR Version: 1.4.9
Type "pecl help options" to list all options.
PHP Version: 5.2.10
Type "pecl help shortcuts" to list all command shortcuts.
Zend Engine Version: 2.2.0
Type "pecl help <command>" to get the help for the specified command.
Running on: Linux jmnote.com 2.6.18-274.3.1.el5xen #1 SMP Tue Sep 6 20:57:11 EDT 2011 x86_64
</source>
</source>
<source lang='dos'>
<source lang='dos'>

2012년 9월 9일 (일) 12:52 판

APC

1 사전작업

pecl install로 설치할 예정인데, 정상적으로 설치하기 위해서는 pecl, gcc, phpize, make 명령어를 사용할 수 있는 환경이 되어야 한다.

설치확인
[root@jmnote ~]# pecl version
PEAR Version: 1.4.9
PHP Version: 5.2.10
Zend Engine Version: 2.2.0
Running on: Linux jmnote.com 2.6.18-274.3.1.el5xen #1 SMP Tue Sep 6 20:57:11 EDT 2011 x86_64
[root@jmnote ~]# gcc
gcc: no input files
[root@jmnote ~]# phpize
Cannot find config.m4. 
Make sure that you run '/usr/bin/phpize' in the top level source directory of the module
[root@jmnote ~]# make 
make: *** No targets specified and no makefile found.  Stop.
→ 정상적으로 설치되어 있다면 위와 같이 나온다.

2 APC 설치

명령어
pecl install apc
실행예시
[root@jmnote ~]# pecl install apc
downloading APC-3.1.9.tgz ...
Starting to download APC-3.1.9.tgz (155,540 bytes)
.................................done: 155,540 bytes
54 source files, building
running: phpize
Configuring for:
PHP Api Version:         20041225
Zend Module Api No:      20060613
Zend Extension Api No:   220060519
Enable internal debugging in APC [no] :

Enter 키 입력.

Enable per request file info about files used from the APC cache [no] : 
Enable spin locks (EXPERIMENTAL) [no] : 
Enable memory protection (EXPERIMENTAL) [no] : 
Enable pthread mutexes (default) [yes] : 
Enable pthread read/write locks (EXPERIMENTAL) [no] :

모두 Enter 키 입력

... (생략)
Build process completed successfully
Installing '/var/tmp/pear-build-root/install-APC-3.1.9//usr/include/php/ext/apc/apc_serializer.h'
Installing '/var/tmp/pear-build-root/install-APC-3.1.9//usr/lib64/php/modules/apc.so'
install ok: channel://pecl.php.net/APC-3.1.9
You should add "extension=apc.so" to php.ini
→ 정상적으로 빌드되었으며, /usr/lib64/php/modules/apc.so 이 생성되었다.
php.iniextension=apc.so를 추가해야 한다고 알려준다.

3 PHP와 APC 연동

위에서는 php.ini에 추가하라고 했지만, /etc/php.d에 별도의 파일로 추가해도 된다. 추가 후에는 아파치를 재시작해야 한다.

명령어
echo 'extension=apc.so' > /etc/php.d/apc.ini
service httpd restart
실행예시
[root@jmnote ~]# echo 'extension=apc.so' > /etc/php.d/apc.ini
[root@jmnote ~]# service httpd restart
Stopping httpd:                                            [  OK  ]
Starting httpd:                                            [  OK  ]

4 같이 보기

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}