리눅스 관련팁 게시판입니다.
  • 웹미니 한줄 전광판 영역 입니다.
글 수 49

0

조회 수 : 8263 신고 : 0

작성자 : hhkwoong
포인트 : 282 | 레벨 : 1

오늘은 지난시간에 이어 3번째 시간으로 PHP 와 Zend Optimizer 의 설치를 진행하여 보도록 하겠습니다.
다시한번 자세한 설치 버전은 아래와 같습니다. (버전이 틀려도 설치 방법의 거의 비슷합니다.)

 CentOS 5.3 + Apache 2.2.13 + MySQL 4.0.27 + php 4.4.7 + Zend 3.3.3 + phpMyAdmin

설치 순서는 라이브러리설치 => MySQL => Apache => PHP => Zend => phpMyAdmin 순입니다.

1. 관련 라이브러리 확인 & 설치
- openssl 을 기본적으로 등록시킬 예정이므로 관련 라이브러리를 설치하도록 합니다.
[root@cubetree ~]# yum -y install openssl openssl-devel mhash mhash-devel libtool libtool-ltdl libtool-ltdl-devel imap-devel imap zlib-devel zlib freetype-devel freetype libpng-devel libpng libjpeg-devel libjpeg libtiff-devel libtiff gd-devel gd pcre-devel pcre libxml-devel libxml libxml2-devel libxml2 gdbm-devel gdbm ncurses-devel ncurses curl-devel curl expat-devel expat bzip2-devel bzip2-libs bzip2 uw-imap-devel libc-client libc-client-devel libmcrypt libmcrypt-devel libidn libidn-devel krb5-devel gmp* expat*

생  략

Installed: bzip2-devel.i386 0:1.0.3-4.el5_2 bzip2-devel.x86_64 0:1.0.3-4.el5_2 curl-devel.x86_64 0:7.15.5-2.1.el5_3.5 curl-devel.i386 0:7.15.5-2.1.el5_3.5 expat-devel.i386 0:1.95.8-8.2.1 expat-devel.x86_64 0:1.95.8-8.2.1 gdbm.i386 0:1.8.0-26.2.1 gdbm-devel.i386 0:1.8.0-26.2.1 gdbm-devel.x86_64 0:1.8.0-26.2.1 gmp.i386 0:4.1.4-10.el5 gmp-devel.i386 0:4.1.4-10.el5 gmp-devel.x86_64 0:4.1.4-10.el5 libc-client.x86_64 0:2004g-2.2.1 libc-client.i386 0:2004g-2.2.1 libc-client-devel.x86_64 0:2004g-2.2.1 libc-client-devel.i386 0:2004g-2.2.1 libidn-devel.x86_64 0:0.6.5-1.1 libidn-devel.i386 0:0.6.5-1.1 libmcrypt-devel.x86_64 0:2.5.8-4.el5.centos libtool.x86_64 0:1.5.22-6.1 libtool-ltdl.i386 0:1.5.22-6.1 libtool-ltdl-devel.x86_64 0:1.5.22-6.1 libtool-ltdl-devel.i386 0:1.5.22-6.1 libxml2-devel.i386 0:2.6.26-2.1.2.8 libxml2-devel.x86_64 0:2.6.26-2.1.2.8 mhash.x86_64 0:0.9.9-1.el5.centos mhash-devel.x86_64 0:0.9.9-1.el5.centos ncurses-devel.x86_64 0:5.5-24.20060715 ncurses-devel.i386 0:5.5-24.20060715 pcre.i386 0:6.6-2.el5_1.7 pcre-devel.i386 0:6.6-2.el5_1.7 pcre-devel.x86_64 0:6.6-2.el5_1.7 zlib-devel.i386 0:1.2.3-3
Dependency Installed: autoconf.noarch 0:2.59-12 automake.noarch 0:1.9.6-2.1 imake.x86_64 0:1.0.2-3
Complete!
[root@cubetree ~]#

2. PHP 설치

■ Configure
[root@cubetree php-4.4.7]# ./configure --prefix=/home/Product/php-4.4.7 --with-apxs2=/usr/local/apache/bin/apxs --enable-mod-charset --enable-safe-mode --enable-sigchild --enable-magic-quotes --with-libxml-dir --with-openssl --with-zlib --with-zlib-dir --with-bz2 --enable-calendar --with-curl --enable-dba --with-gdbm --enable-exif --enable-ftp --with-gd --with-jpeg-dir --with-png-dir  --with-ttf --with-freetype-dir --enable-gd-native-ttf --with-gettext --with-imap --with-imap-ssl --with-kerberos --enable-mbstring --with-mhash --with-mcrypt --with-mysql=/usr/local/mysql --enable-sockets --with-regex=php --enable-sysvmsg --enable-sysvsem --enable-sysvshm --enable-wddx --enable-zend-multibyte

생  략

+--------------------------------------------------------------------+
| License:                                                                                                        |
| This software is subject to the PHP License, available in this                        |
| distribution in the file LICENSE.  By continuing this installation                        |
| process, you are bound by the terms of this license agreement.                  |
| If you do not agree with the terms of this license, you must abort                  |
| the installation process at this point.                                                             |
+--------------------------------------------------------------------+
|                          *** NOTE ***                                                                        |
|            The default for register_globals is now OFF!                                       |
|                                                                                                                       |
| If your application relies on register_globals being ON, you                          |
| should explicitly set it to on in your php.ini file.                                              |
| Note that you are strongly encouraged to read                                             |
| http://www.php.net/manual/en/security.globals.php                                    |
| about the implications of having register_globals set to on, and                    |
| avoid using it if possible.                                                                                |
+--------------------------------------------------------------------+

Thank you for using PHP.

[root@cubetree php-4.4.7]#

■ Tip

"configure: error: ZLIB extension requires zlib >= 1.0.9" 와 같은 에러메세지가 나온다면, 아래와 같이 심볼릭 링크를 생성후에 다시 configure 해보시길 바랍니다.

ln -sf /usr/lib64/libgssapi_krb5.so.2.2 /usr/lib/libgssapi_krb5.so
ln -sf /usr/lib64/libkrb5.so.3.3 /usr/lib/libkrb5.so
ln -sf /usr/lib64/libk5crypto.so.3.1 /usr/lib/libk5crypto.so
ln -sf /lib64/libcom_err.so.2 /usr/lib/libcom_err.so
ln -sf /usr/lib64/libgcrypt.so.11 /usr/lib/libgcrypt.so
ln -sf /usr/lib64/libgpg-error.so.0 /usr/lib/libgpg-error.so
ln -sf /usr/lib64/libexpat.so /usr/lib/libexpat.so
ln -sf /usr/lib64/libm.so /usr/lib/libm.so
ln -sf /usr/lib64/libssl.so /usr/lib/libssl.so

■ Make / Make install
[root@cubetree php-4.4.7]# make

생  략

Build complete.

(It is safe to ignore warnings about tempnam and tmpnam).
[root@cubetree php-4.4.7]# make install
Installing PHP SAPI module:       apache2handler
/home/Product/httpd-2.2.13/build/instdso.sh SH_LIBTOOL='/home/Product/httpd-2.2.13/build/libtool' libphp4.la /home/Product/httpd-2.2.13/modules
/home/Product/httpd-2.2.13/build/libtool --mode=install cp libphp4.la /home/Product/httpd-2.2.13/modules/
cp .libs/libphp4.so /home/Product/httpd-2.2.13/modules/libphp4.so
cp .libs/libphp4.lai /home/Product/httpd-2.2.13/modules/libphp4.la
libtool: install: warning: remember to run `libtool --finish /home/apm/php-4.4.7/libs'
chmod 755 /home/Product/httpd-2.2.13/modules/libphp4.so
[activating module `php4' in /home/Product/httpd-2.2.13/conf/httpd.conf]
Installing PHP CLI binary:        /home/Product/php-4.4.7/bin/
Installing PHP CLI man page:      /home/Product/php-4.4.7/man/man1/
Installing PEAR environment:      /home/Product/php-4.4.7/lib/php/
[PEAR] Archive_Tar    - installed: 1.3.2
[PEAR] Console_Getopt - installed: 1.2.1
[PEAR] HTML_Template_IT- installed: 1.1
[PEAR] Net_UserAgent_Detect- installed: 2.0.1
warning: pear/PEAR requires package "pear/Structures_Graph" (recommended version 1.0.2)
pear/PEAR can optionally use package "pear/XML_RPC" (version >= 1.4.0)
[PEAR] PEAR           - installed: 1.5.0
Wrote PEAR system config file at: /home/Product/php-4.4.7/etc/pear.conf
You may want to add: /home/Product/php-4.4.7/lib/php to your php.ini include_path
[PEAR] Structures_Graph- installed: 1.0.2
Installing build environment:     /home/Product/php-4.4.7/lib/php/build/
Installing header files:          /home/Product/php-4.4.7/include/php/
Installing helper programs:       /home/Product/php-4.4.7/bin/
  program: phpize
  program: php-config
Installing man pages:             /home/Product/php-4.4.7/man/man1/
  page: phpize.1
  page: php-config.1
[root@cubetree php-4.4.7]#

■ PHP 환경파일 (php.ini) 복사
- 다운로드 받은 PHP 소스파일중에 php.ini-dist (sample) 을 해당 경로에 복사하여 줍니다.

[root@cubetree php-4.4.7]# cp php.ini-dist /home/Product/php-4.4.7/lib/php.ini

■ Apache 재시작
[root@cubetree php-4.4.7]# apachectl restart
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
[root@cubetree php-4.4.7]#

■ PHP 심볼릭 링크 생성
[root@cubetree bin]# ln -s /home/Product/php-4.4.7/bin /usr/local/php
[root@cubetree bin]#

■ PHP profile 등록
[root@cubetree bin]# vi /root/.bash_profile
PATH=$PATH:$HOME/bin:/usr/local/bin:/usr/local/mysql/bin:/usr/local/php/bin 을 추가하고,
shell 재시작

■ PHP 설치 확인
[root@cubetree ~]# php -v
PHP 4.4.7 (cli) (built: Sep 28 2009 10:45:07)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies
[root@cubetree ~]#

■ PHP 설치 및 설정 확인
httpd.conf 수정을 통한 apache 와 php 모듈 연동

아래와 같은 부분을 찾아서

AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz

이렇게 변경하고 apache 를 restart
AddType application/x-compress .Z
AddType application/x-httpd-php .htm .html .php .ph php3 .php4 .phtml .inc
AddType application/x-httpd-php-source .phps
AddType application/x-gzip .gz .tgz

■ PHP 설치 및 설정 확인
[root@cubetree htdocs]# pwd
/home/Product/httpd-2.2.13/htdocs
[root@cubetree htdocs]# vi phpinfo.php
<? phpinfo(); ?>
[root@cubetree htdocs]#


2. Zend Optimizer 설치
현재 Zend Optimizer 의 최신 버전은 3.3.9 입니다. 3.3.3 버전 이후로는 install.sh 이 없어져 설치하는게 조금 복잡해 졌습니다. 저는 3.3.3 버전을 이용하여 install.sh 을 이용하여 간편(?) 하게 설치해 보려고 합니다.
3.3.3 버전의 다운로드 주소는 http://downloads.zend.com/optimizer/3.3.3/ZendOptimizer-3.3.3-linux-glibc23-x86_64.tar.gz 입니다. 그 외에 버전을 다운 받기 위해서는 http://www.zend.com/ 에 접속하셔서 직접 다운로드 하시기 바랍니다.
■ Install
[root@cubetree apm]# cd ZendOptimizer-3.3.3-linux-glibc23-x86_64
[root@cubetree ZendOptimizer-3.3.3-linux-glibc23-x86_64]# ls
EULA-ZendOptimizer  Inventory.xml  LICENSE  README-ZendOptimizer  data  install  install-tty  install.sh  md5  zui_files
[root@cubetree ZendOptimizer-3.3.3-linux-glibc23-x86_64]# ./install.sh

■ GUI 설치과정
1. Zend Optimizer 3.3.3 의 GUI Install 화면입니다. 환영 메세지가 보이네요.

2. Zend Optimizer 의 License 에 대한 내용을 보여주고 있습니다.

3. License 에 동의한다 "Yes" 를 선택하세요!

4. Zend Optimizer 가 설치될 경로를 적어주세요. 저는 /home/Product 밑에 apache 와 PHP, MySQL 모두 설치되어 있기 때문에 역시 해당 경로에 설치를 하도록 하겠습니다.

5. PHP 설정파일인 php.ini 가 위치한 경로를 적어줍니다. 앞서 본바와 같인 php.ini-dist 를 복사하여 넣어준 php.ini 의 경로를 설정하여 줍니다.

6. Apache 서버를 사용하고 있냐고 물어봅니다. 당연히 사용을 하고 있으므로 "Yes" 를 선택합니다.

7. apache 실행 명령인 apachectl 명령어의 경로를 선택하여 줍니다. 저는 /home/Product/httpd-2.2.13/bin 밑에 있지만 심볼릭 링크를 걸어두었으므로 /usr/local/apache/bin/apachectl 이라고 적었습니다. 본래의 경로를 적으셔도 무방합니다.

8. php.ini 가 Zend 의 환경에 맞도록 수정되었으며, 기존 파일은 .bak 이라는 확장자로 백업되었다는 내용을 담고 있습니다.

9. 설치가 완료되었습니다. Zend Optimizer 를 사용하기 위해서는 반드시 apache 를 리부팅 해야 효과가 적용됩니다.

10. Apache 를 재실행 할 것인지 물어봅니다. "Yes" 를 선택하여 Apache 데몬을 재실행합니다.

11. Apache 가 재실행 되고 있습니다.

12. 재시작이 성공되었습니다.

13. 설치가 완료 되었으며, 다시 phpinfo 파일을 확인하여 보면 아래와 같이 Zend Optimizer 가 활성화 된것을 확인하실수 있습니다.

이상 이번 PHP 와 Zend Optimizer 의 설치 포스팅을 마치도록 하겠습니다.
다음 포스팅에서는 마지막으로 phpmyadmin 을 설치하여 웹페이지에서 mysql 을 컨트롤 할 수 있는 설치과정에 대하여 알아보도록 하겠습니다.
모든분들 열공하시기 바랍니다^^

태그
소중한 댓글 부탁드립니다.
추천수 10단위당 메달이 1개씩 노출되고, 추천수에 따라 배경색이 변하며, 일정수의 추천수를 받을시 BEST 아이콘이 붙게됩니다.
추천수에 따른 배경색 보기 본문으로 바로가기
  • 추천수 50개이상
  • 추천수 30개이상
  • 추천수 20개이상
  • 추천수 10개이상
  • 추천수 3개이상
닫기

첫번째 댓글을 남겨주세요!

List of Articles
번호 제목 글쓴이 날짜 추천 수 조회 수sort
49 Linux APM 설치 (Compile) 3부 - PHP & Zend 설치 hhkwoong 2009-10-07   8263
48 리눅스에서 특정 파일을 제외하고 삭제하기 어드민플레이 2009-09-08   7887
47 /etc/passwd 구조 어드민플레이 2010-04-17 1 7490
46 Linux APM 설치 (Compile) 4부 - phpmyadmin 설치 hhkwoong 2009-10-07   6651
45 rewrite 모듈을 이욜한 서브도메인으로 홈페이지 운영하기 어드민플레이 2010-04-18   6624
44 아파치 컴파일 에러(apr-util) configure: error: cannet use an external APR-util with the bundled APR 어드민플레이 2010-04-18   6507
43 CentOS 5.3에 TTF 폰트 설치 하기 레드후디 2010-01-16 1 6403
42 crontab 사용 방법 어드민플레이 2009-09-08   6240
41 리눅스 계정 삭제, 접속 차단 어드민플레이 2009-09-08   6090
40 Linux APM 설치 (Compile) 1부 - MySQL 설치 [2] hhkwoong 2009-10-07   6015
39 squid 로 웹서버 가속하기..---== 강추 ==--- 어드민플레이 2010-04-18 1 5877
38 Linux APM 설치 (Compile) 2부 - Apache (httpd) 설치 hhkwoong 2009-10-07   5586
37 DNS 포워더 설정 어드민플레이 2010-04-17   5465
36 apache + oracle (오라클 DB 한글깨짐) 어드민플레이 2010-04-15   5159
35 vsftpd.conf 의 주요 설정 어드민플레이 2009-09-29   5103
34 CentOS5,Fedora7 네임서버 설정법 어드민플레이 2010-04-17   5088
33 apache2 worker 방식 client 수치 설정법 어드민플레이 2010-04-18   4757
32 apache log에 그림이미지 파일 로그 안남기기 [1] 어드민플레이 2010-04-18   4698
31 브라우저 접속 제한하기 어드민플레이 2010-04-18   4689
30 DNS TCP53, UDP53 용도 어드민플레이 2010-04-17   4633