Skip to content

조회 수 8736 추천 수 0 댓글 1
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
mbstring 모듈 올리기 

설치 시 ./configure 옵션에 --enable=mbstring 추가 하는 방법 (php 재설치 해야함) 과
재설치 하지 않고 확장 모듈 올리는 방법 두가지 방법이 있다.



1. 모듈 만들기

php 설치 경로 (/usr/local/php) /bin 의 phpize, php-config 확인

php 소스 경로 (/usr/local/src/apm/php) 의 ext 디렉토리에서 모듈을 만들 수 있고,
그 디렉토리에 mbstring 이 있음을 확인 할 수 있으며, 필요로 하는 모듈 소스가 /ext 안에 없을 경우
인터넷에서 소스를 구해 같은 방법으로 올리면 된다.


반드시 mbstring 디렉토리 안에서 실행해야 된다.

]# cd /usr/local/src/apm/php/ext/mbstring

]# /usr/local/php/bin/phpize
Configuring for:
PHP Api Version:        20020918
Zend Module Api No:      20020429
Zend Extension Api No:  20050606

 mysqli 컴파일 할때는 아래 옵션
./configure --with-php-config=/usr/local/php/bin/php-config --with-mysqli=/usr/local/mysql/bin/mysql_config


]# ./configure --with-php-config=/usr/local/php/bin/php-config
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking for egrep... grep -E
checking for a sed that does not truncate output... /bin/sed
checking for gcc... gcc
checking for C compiler default output file name... a.out
.
.
.
checking whether to build shared libraries... yes
checking whether to build static libraries... no
checking whether -lc should be explicitly linked in... no
creating libtool
configure: creating ./config.status
config.status: creating config.h

]# make
.
.
.
creating mbstring.la
(cd .libs && rm -f mbstring.la && ln -s ../mbstring.la mbstring.la)
/bin/sh /usr/local/src/apm/php/ext/mbstring/libtool --mode=install cp ./mbstring.la /usr/local/src/apm/php/ext/mbstring/modules
cp ./.libs/mbstring.so /usr/local/src/apm/php/ext/mbstring/modules/mbstring.so
cp ./.libs/mbstring.lai /usr/local/src/apm/php/ext/mbstring/modules/mbstring.la
PATH="$PATH:/sbin" ldconfig -n /usr/local/src/apm/php/ext/mbstring/modules
----------------------------------------------------------------------
Libraries have been installed in:
  /usr/local/src/apm/php/ext/mbstring/modules  <- 만들어진 모듈이 있는 디렉토리
 
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
  - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
    during execution
  - add LIBDIR to the `LD_RUN_PATH' environment variable
    during linking
  - use the `-Wl,--rpath -Wl,LIBDIR' linker flag
  - have your system administrator add LIBDIR to `/etc/ld.so.conf'
 
See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
 
Build complete.
(It is safe to ignore warnings about tempnam and tmpnam).


2. 설정 파일 수정 하기

만들어진 모듈을 적당한 위치로 옮긴 후 php.ini 파일을 수정 해 주면 된다.

ex) 
/usr/local/php 에 module 디렉토리를 만들고 그 디렉토리에 만들어진 모듈을 복사.

]# cd /usr/local/php/module

]# cp /usr/local/src/apm/php/ext/mbstring/module/mbstring.so ./

]# cd /usr/local/php/lib <- php.ini 파일이 있는 곳

]# vi php.ini

428 줄의 extension_dir = "./" 부분을 모듈이 있는 디렉토리로 설정
(이 부분의 설정이 제대로 이루어지지 않으면 적용이 안됨)

extension_dir = "/usr/local/php/module"

그 아래 추가 extension=mbstring.so <- 모듈명 정확히 써야 됨.

]# service httpd restart


@@@@ 유의사항 @@@@
extension_dir="./"    부분에서 2개이상의 모듈을 동시에 사용할 경우 각 모듈명간 ;(세미콜론)으로 구분짓고 제일 마직막 모듈에는 ; (세미콜론)을 생략 한다.
  • ?
    까끙 2009.01.19 12:54
    phpize 는 ./configure 를 할수 있게 config 파일을 생성해줌~ 푸힛

Copyright ADMINPLAY corp. All rights reserved.

abcXYZ, 세종대왕,1234

abcXYZ, 세종대왕,1234