문서 편집 권한이 없습니다. 다음 이유를 확인해주세요: 요청한 명령은 다음 권한을 가진 사용자에게 제한됩니다: 사용자. 문서의 원본을 보거나 복사할 수 있습니다. {{다른뜻|우분투 APC 설치}} ;CentOS Alternative PHP Cache 설치 ;CentOS APC 설치 ==사전작업== pecl install로 설치할 예정인데, 정상적으로 설치하기 위해서는 pecl, gcc, phpize, make 명령어를 사용할 수 있는 환경이 되어야 한다. *[[pecl 설치]] (설치여부는 명령어 <code>pecl version</code>로 확인) *[[gcc 설치]] (설치여부는 명령어 <code>gcc</code>로 확인) *[[php-devel 설치]] (설치여부는 명령어 <code>phpize</code>로 확인) *[[make 설치]] (설치여부는 명령어 <code>make</code>로 확인) *[[pcre-devel 설치]] ;한방 설치 명령어 <syntaxhighlight lang='bash'> yum install php-pear gcc php-devel make pcre-devel </syntaxhighlight> ;설치확인 <syntaxhighlight lang='console'> [root@zetawiki ~]# 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 </syntaxhighlight> <syntaxhighlight lang='console'> [root@zetawiki ~]# gcc gcc: no input files </syntaxhighlight> <syntaxhighlight lang='console'> [root@zetawiki ~]# phpize Cannot find config.m4. Make sure that you run '/usr/bin/phpize' in the top level syntaxhighlight directory of the module </syntaxhighlight> <syntaxhighlight lang='console'> [root@zetawiki ~]# make make: *** No targets specified and no makefile found. Stop. </syntaxhighlight> <syntaxhighlight lang='console'> [root@zetawiki ~]# yum list installed php-pear gcc php-devel make pcre-devel ... (생략) Installed Packages gcc.x86_64 4.4.7-3.el6 @base make.x86_64 1:3.81-20.el6 @base pcre-devel.x86_64 7.8-6.el6 @base php-devel.x86_64 5.3.3-22.el6 @base php-pear.noarch 1:1.9.4-4.el6 @base </syntaxhighlight> :→ 정상적으로 설치되어 있다면 위와 같이 나온다. ==APC 설치== ;명령어 <syntaxhighlight lang='bash'> pecl install apc </syntaxhighlight> ;실행예시 <syntaxhighlight lang='console'> [root@zetawiki ~]# pecl install apc downloading APC-3.1.13.tgz ... Starting to download APC-3.1.13.tgz (171,591 bytes) .....................................done: 171,591 bytes 55 syntaxhighlight files, building running: phpize Configuring for: PHP Api Version: 20090626 Zend Module Api No: 20090626 Zend Extension Api No: 220090626 Enable internal debugging in APC [no] : </syntaxhighlight> {{Enter}} 키 입력. <syntaxhighlight lang='console'> 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) [no] : Enable pthread read/write locks (EXPERIMENTAL) [yes] : </syntaxhighlight> 모두 {{Enter}} 키 입력 <syntaxhighlight lang='console'> ... (생략) Build process completed successfully Installing '/usr/lib64/php/modules/apc.so' Installing '/usr/include/php/ext/apc/apc_serializer.h' install ok: channel://pecl.php.net/APC-3.1.13 configuration option "php_ini" is not set to php.ini location You should add "extension=apc.so" to php.ini </syntaxhighlight> :→ 정상적으로 빌드되었으며, /usr/lib64/php/modules/apc.so 이 생성되었다. :→ [[php.ini]]에 <code>extension=apc.so</code>를 추가해야 한다고 알려준다. ==PHP와 APC 연동== ===VirtualHost 없는 경우=== <syntaxhighlight lang='console'> [root@zetawiki ~]# php -m | grep apc </syntaxhighlight> :→ 연동 안됨 *[[php.ini]]의 맨아래에 다음 내용을 추가 <syntaxhighlight lang='properties'> [apc] extension=apc.so </syntaxhighlight> <syntaxhighlight lang='console'> [root@zetawiki ~]# php -m | grep apc apc </syntaxhighlight> :→ 연동됨 ===VirtualHost 있는 경우=== [[httpd.conf]]에서 VirtualHost를 사용하는 경우에는 정상작동을 위해 조금 다른 설정이 필요하다.<ref>여러 VirtualHost에 적용이 되지 않는 모양이다.</ref> *php.ini의 맨아래에 다음 내용을 추가 <syntaxhighlight lang='properties'> [apc] extension=apc.so apc.cache_by_default=0 </syntaxhighlight> :→ 일단 apc 캐시를 사용하지 않도록 설정 *캐시되기 원하는 VirtualHost의 웹루트폴더의 .htaccess 파일에 다음 내용 추가 <syntaxhighlight lang='php'> php_flag apc.cache_by_default On </syntaxhighlight> ==아파치 재시작== <syntaxhighlight lang='console'> [root@zetawiki ~]# service httpd restart Stopping httpd: [ OK ] Starting httpd: [ OK ] </syntaxhighlight> ==같이 보기== *[[Warning: Could not find APC, XCache or WinCache.]] *[[OCI8 설치]] *[[ERR_EMPTY_RESPONSE]] *[[미디어위키 성능 개선]] *[[아파치 연동 모듈 확인]] *[[APC]] ==주석== <references/> [[분류: PHP]] [[분류: APC]] 이 문서에서 사용한 틀: 틀:Enter (원본 보기) 틀:다른 뜻 (원본 보기) 틀:다른뜻 (원본 보기) 틀:유니코드 (원본 보기) 틀:키 (원본 보기) 틀:키눌림 (원본 보기) 틀:키눌림/core (원본 보기) CentOS APC 설치 문서로 돌아갑니다.