5. php 설치전 Gd 관련 업데이트
5-1. 기존 GD 관련 RPM 패키지 제거
Gd 관련 업데이트시 꼭 필요한 항목은 gd, freetype 입니다. 이 두개는 필히 설치하시기 바랍니다.
최신버전으로 다시 설치하기 위해 rpm으로 설치된 기존 패키지들을 지우고 다시 설치합니다.(다음중 자신에게 설치된 항목만 지웁니다. )
※ 이것을 잘못하면 php설치나 기타 설치시 에러가 날수 있습니다. 지우지 않아도 -Uvh 명령으로 업데이트 및 신규설치가 가능하니 초보자라면 지우지 않는게 좋습니다. 단 t1lib는 Redhat 7.3 설치시 t1lib는 설치가 되지 않으니 PHP 설치시 옵션으로 넣으실거라면 꼭 설치를 하셔야 합니다.
지우기에 앞서 알아둘것은 이것들은 mysql-php-apache 설치후 따로 설치가 가능하지만
mysql-php-apache 설치시 옵션으로 넣어서 설치하여 작업을 한번에 마치도록 하는게 좋겠죠
기존 Gd 관련 RPM 패키지 삭제
rpm -e --nodeps zlib
rpm -e --nodeps zlib-devel
rpm -e --nodeps freetype
rpm -e --nodeps freetype-devel <-- 7.3의 경우 설치 안됨
rpm -e --nodeps freetype-utils <-- 7.3의 경우 설치 안됨
rpm -e --nodeps gd
rpm -e --nodeps gd-devel
rpm -e --nodeps libjpeg
rpm -e --nodeps libjpeg-devel
rpm -e --nodeps libpng
rpm -e --nodeps libpng-devel
rpm -e --nodeps libungif
rpm -e --nodeps libungif-devel <-- 7.3의 경우 설치 안됨
rpm -e --nodeps libtiff
rpm -e --nodeps libtiff-devel
--------------------------------------------------------------------------------------------
설치
gd는 php 설치시 옵션으로 반드시 설치를 해야 한다.
# make install
..
..
ldl -lnsl -lcrypt -lcrypt -o sapi/cli/php
ext/mysql/libmysql/my_tempnam.lo: In function `my_tempnam':
/usr/local/src/php-4.3.10/ext/mysql/libmysql/my_tempnam.c:115: the use of `tempnam' is dangerous, better use `mkstemp'
Build complete.
(It is safe to ignore warnings about tempnam and tmpnam).
make 시 에러이다.
php버전이 어느 이상부터는 gd가 번들된다.
따라서 gd가 충돌되서 나오는 에러인듯하다.
래드햇 리눅스 설치후 기본 gd이다.
# rpm -qa | grep gd
gd-devel-1.8.4-4
gd-1.8.4-4
지운다.
# rpm -e --nodeps gd
# rpm -e --nodeps gd-devel
===========================================
1. zlib 설치 – 기본 라이브러리를 올림
1-1. zlib 설치전 주의사항
리눅스 설치하면 zlib의 libz.so파일들은 /usr/lib에 존재한다.
zlib의 경우 rpm설치된것을 지우면 /usr/lib에 위치한 libz.so, libz.so.1파일이 제거가 된다.
rpm -qa 명령어의 경우 /usr/lib에 위치한 libz.so.1파일이 있어야 하는데 지웠으니 당연히 아래와 같은 에러가 난다.
# rpm -qa | grep 패키지명
/usr/lib/rpm/rpmq: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory
이럴경우 php에서도 에러가 날것이고 문제가 생긴다.
만일 /usr/local/src/zlib-1.2.1에서 설치과정을 모두 마치면 /usr/local/src/zlib-1.2.1 디렉토리에 libz관련 파일이 4개가 생긴다.
4개 파일: libz.a libz.so libz.so.1 libz.so.1.2.1
/usr/local/lib에는 libz.a 파일 한개가 생긴다.
현재 디렉토리는 /usr/local/src/zlib-1.2.1 이다.
libz.so 파일들은 /usr/lib에 있어야 하므로
# cp libz.so* /usr/lib
이렇게 /usr/local/src/zlib-1.2.1 에 있는 libz.so 파일 4개를 /usr/lib에 복사하여야 정상적으로 설치가 된다.
이제 # rpm -qa | grep zlib 해도 아무런 에러가 나지 않고 아무것도 안나온다. rpm을 지우고 소스로 설치했으니 당연한 일이다.
1-2 다운받기
http://www.gzip.org/zlib/ 에서 zlib 을 다운 받는다.
1-3 압축풀기
# tar xzvf zlib-1.2.1.tar.gz
1-4 설치
# cd zlib-1.2.1
# ./configure -s // libz.so 동적모듈생성 -s 는 -shared 의 줄임말
# make
# ./configure // libz.a 정적모듈생성
# make test
# make install
# cp libz.so* /usr/lib
------------------------------
# cp libz.so* /usr/local/lib
# cd /usr/local/lib
# rm -f libz.so
# rm -f libz.so.1
# ln -s libz.so.1.2.1 libz.so
# ln -s libz.so.1.2.1 libz.so.1
이부분은 해야하나 말아야 하는지 확인을 안해봐서 잘 모르겠다.
소프트 링크를 하지 않아도 자동적으로 된것 같기도 한다.
그저 단지 /usr/local/src/zlib-1.2.1 에 있는 libz.so* 파일들만 /usr/lib로 카피하면 될듯하다.
중요한건 저 파일들이 /usr/lib에 있어야 한다는 것.
------------------------------
rpm 설치시 lib 는 /usr/lib 이므로
# vi /etc/ld.so.conf // 라이브러리 경로 추가
/usr/local/lib 이줄을 추가해준다
# ldconfig 명령 실행 // 라이브러리 경로 적용명령
2. gd 설치
http://www.boutell.com/gd/http/ 에서 gd 최신 버전을 다운 받는다.
# tar xzvf gd-2.0.33.tar.gz
# cd gd-2.0.33
# ./configure --prefix=/usr/local/gd
# make
# make install
3. freetype 설치
http://prdownloads.sourceforge.net/freetype/freetype-2.1.5.tar.gz?download 에서 freetype 의 최신 버전을 다운 받는다.
# tar -xvzf freetype-2.1.5.tar.gz
# cd freetype-2.1.5
# make setup
# make install
=======================================================================================
./configure --prefix=/usr/local/freetype-2.1.7
cd builds/unix; ./configure --prefix=/usr/local/freetype-2.1.7
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking target system type... i686-pc-linux-gnu
checking for gcc... gcc
.
중략
.
FreeType build system -- automatic system detection
The following settings are used:
platform unix
compiler cc
configuration directory ./builds/unix
configuration rules ./builds/unix/unix.mk
If this does not correspond to your system or settings please remove the file
`config.mk' from this directory then read the INSTALL file for help.
Otherwise, simply type `make' again to build the library,
or `make refdoc' to build the API reference (the latter needs python).
make: Nothing to be done for `unix'.
[root@neodal freetype-2.1.7]#
아래와 같이 실행하여 컴파일과 컴파일 적용을 함꺼번에 하도록 하자.
[root@neodal freetype-2.1.7]# make && make install
/usr/local/src/freetype-2.1.7/builds/unix/libtool --mode=compile gcc -pedantic -ansi \
-I/usr/local/src/freetype-2.1.7/objs -I/usr/local/src/freetype-2.1.7/builds/unix \
-I/usr/local/src/freetype-2.1.7/include -c -Wall -g -O2 \
-DFT_CONFIG_OPTION_SYSTEM_ZLIB -DDARWIN_NO_CARBON -DFT_CONFIG_CONFIG_H="" \
-o /usr/local/src/freetype-2.1.7/objs/ftsystem.lo /usr/local/src/freetype-2.1.7/builds/unix/ftsystem.c
mkdir /usr/local/src/freetype-2.1.7/objs/.libs
gcc -pedantic -ansi -I/usr/local/src/freetype-2.1.7/objs \
-I/usr/local/src/freetype-2.1.7/builds/unix -I/usr/local/src/freetype-2.1.7/include \
-c -Wall -g -O2 -DFT_CONFIG_OPTION_SYSTEM_ZLIB -DDARWIN_NO_CARBON \
"-DFT_CONFIG_CONFIG_H=" /usr/local/src/freetype-2.1.7/builds/unix/ftsystem.c \
-fPIC -DPIC -o /usr/local/src/freetype-2.1.7/objs/.libs/ftsystem.o
gcc -pedantic -ansi -I/usr/local/src/freetype-2.1.7/objs \
-I/usr/local/src/freetype-2.1.7/builds/unix -I/usr/local/src/freetype-2.1.7/include -c \
-Wall -g -O2 -DFT_CONFIG_OPTION_SYSTEM_ZLIB -DDARWIN_NO_CARBON \
"-DFT_CONFIG_CONFIG_H=" /usr/local/src/freetype-2.1.7/builds/unix/ftsystem.c \
-o /usr/local/src/freetype-2.1.7/objs/ftsystem.o >/dev/null 2>&1
/usr/local/src/freetype-2.1.7/builds/unix/libt
.
중략
.
/usr/bin/install -c -m 755 /usr/local/src/freetype-2.1.7/builds/unix/freetype-config \
/usr/local/freetype-2.1.7/bin/freetype-config
/usr/bin/install -c -m 644 /usr/local/src/freetype-2.1.7/builds/unix/freetype2.m4 \
/usr/local/freetype-2.1.7/share/aclocal/freetype2.m4
/usr/bin/install -c -m 644 /usr/local/src/freetype-2.1.7/builds/unix/freetype2.pc \
/usr/local/freetype-2.1.7/lib/pkgconfig/freetype2.pc
[root@neodal freetype-2.1.7]# ls -al /usr/local/freetype-2.1.7/
합계 24
drwxr-xr-x 6 root root 4096 12월 23 11:17 .
drwxr-xr-x 20 root root 4096 12월 23 11:17 ..
drwxr-xr-x 2 root root 4096 12월 23 11:17 bin
drwxr-xr-x 3 root root 4096 12월 23 11:17 include
drwxr-xr-x 3 root root 4096 12월 23 11:17 lib
drwxr-xr-x 3 root root 4096 12월 23 11:17 share
[root@neodal freetype-2.1.7]#
이 처럼 나타난다면 freetype 또한 설치가 끝났다.
========================================================================================
4. jpeg 설치
ftp://ftp.uu.net/graphics/jpeg/ 에서 jpeg의 최신 버전을 다운 받는다.
# tar xvzf jpegsrc.v6b.tar.gz
# cd jpeg-6b
# ./configure --enable-shared --enable-static
# make
# make test
- make install시 오류 :
/usr/bin/install: cannot create regular file `/usr/local/man/man1/cjpeg.1': 그런 파일이나 디렉토리가 없음
(디렉토리 만들어준다)
# mkdir -p /usr/local/man/man1
# make install
5. libungif 설치
ftp://sunsite.unc.edu/pub/Linux/libs/graphics/ 에서 libungif를 다운 받는다
# tar -xvzf libungif-4.1.0.tar.gz
# cd libungif-4.1.0
# ./configure
# make
# make install
6. libtiff 설치
ftp://ftp.remotesensing.org/pub/libtiff/ 에서 libtiff의 최신 버전을 다운 받는다.
# tar -xzvf tiff-3.7.0.tar.gz
# cd tiff-v3.7.0
# ./configure
...중간에 설치하다 물어보면
yes한다
...
# make
# make install
7. swf 설치
ftp://ftp.sgi.com/sgi/graphics/grafica/flash 에서 swf의 최신 버전을 다운 받는다.
# tar -xvzf dist.99.linux.tar.Z
# mv dist /usr/local/swf
# cd /usr/local/swf
# cp swf.h include
# cp libswf.a lib
8. libpng 설치
ftp://swrinde.nde.swri.edu/pub/png/src 에서 libpng의 최신 버전을 다운 받는다.
# tar xzvf libpng-1.2.8.tar.gz
# cd libpng-1.2.8
# cp scripts/makefile.linux Makefile
# make
# make test
# make install
====================================================================================
http://www.libpng.org/pub/png/libpng.html 에서 libpng의 최신 버전을 다운 받는다.
shell>tar -xvzf libpng-1.2.5.tar.gz
shell>mv libpng-1.2.5 /usr/local/libpng
shell>cd /usr/local/libpng
shell>cp scripts/makefile.linux Makefile
shell>make test
shell>make install
=======================================================================================
9. t1lib 설치
ftp://sunsite.unc.edu/pub/Linux/libs/graphics/ 에서 t1lib을 다운 받는다.
# tar -xvzf t1lib-5.0.2.tar.gz
# cd t1lib-5.0.2
# ./configure
configure finished!
Do: 'make' to compile the t1lib-package.
Do: 'make without_doc' to compile if you do not have LaTeX.
Do: 'make install' to install the t1lib-package.
# make without_doc // 위의 내용그대로 필자는 LaTeX가 없기때문에 make하지 않고 make without_doc로 했습니다.
# make install
10. iconv 설치
http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.9.1.tar.gz
tar xzf liiconv-1.9.1.tar.gz
cd libiconv-1.9.1
./configure --prefix=/usr
make
make install
설치를 완료하시고 php 설치시 iconv 디렉토리는 따로 지정하실 필요는 없습니다.
--with-iconv 한줄로 처리됩니다.
iconv 를 /usr 이 아닌 타 디렉에 설치하시면 경로를 지정해주셔야 합니다.


0