Skip to content

조회 수 8738 추천 수 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 파일을 생성해줌~ 푸힛

List of Articles
번호 제목 글쓴이 날짜 조회 수
48 세션관련 설명입니다 ADMINPLAY 2009.05.13 7625
47 [php모듈] php 소스 암호화 하기 - php_screw-1.5 file ADMINPLAY 2013.03.26 9531
46 [PHP] 정규 표현식 정리 ADMINPLAY 2009.06.29 14896
45 Warning: Unknown: open(, O_RDWR) failed: No such file ... ADMINPLAY 2010.01.29 19757
44 Warning: main(): URL file-access is disabled in the se... ADMINPLAY 2009.06.04 8237
43 Warning: flock(): supplied argument is not a valid str... ADMINPLAY 2009.09.09 16754
42 Ubuntu 7.04 Server 에 Zend Optimizer 3.2.8 설치하기! ADMINPLAY 2009.07.19 11638
41 Ubuntu 에서 PHP Screw 컴파일시 에러날 때 ADMINPLAY 2013.09.07 6974
40 SENDMAIL SPAMASSASSIN 관리 local.cf ADMINPLAY 2009.07.18 11403
39 register_globals 에 따른 서버 변수형 변환 ADMINPLAY 2010.01.09 17862
38 register_globals = off 란? ADMINPLAY 2010.01.09 15537
37 php컴파일에러(flex) configure: error: cannot find out... ADMINPLAY 2009.08.08 16096
36 php에서 curl 설치하기 ADMINPLAY 2009.06.01 16843
35 php세션정리 ADMINPLAY 2009.09.19 17180
34 PHPMyAdmin 오류조치법 Your PHP MySQL library version ... ADMINPLAY 2009.01.20 10023
33 PHPMyAdmin 오류조치법 The mbstring PHP extension was ... ADMINPLAY 2009.01.20 10861
32 PHPMyAdmin - blowfish_secret 해결방법 ADMINPLAY 2009.09.08 16482
31 PHP.INI에서의 세션 관련설명 ADMINPLAY 2009.10.19 17504
30 php.ini 옵션 한글설명 ADMINPLAY 2009.07.18 9628
29 php.ini 세션유지 시간 설정 ADMINPLAY 2009.06.04 10967
Board Pagination Prev 1 2 3 Next
/ 3

Copyright ADMINPLAY corp. All rights reserved.

abcXYZ, 세종대왕,1234

abcXYZ, 세종대왕,1234