Skip to content

조회 수 8740 추천 수 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 php mysql에 insert시 싱글쿼츠(홑따옴표) 입력 처리 (mag... ADMINPLAY 2013.09.07 8922
47 Ubuntu 에서 PHP Screw 컴파일시 에러날 때 ADMINPLAY 2013.09.07 6986
46 [php모듈] php 소스 암호화 하기 - php_screw-1.5 file ADMINPLAY 2013.03.26 9544
45 configure: error: utf8_mime2text() has new signature, ... ADMINPLAY 2010.05.18 21873
44 oracle10g + php5.2.11 error [OCIEnvNlsCreate() failed] ADMINPLAY 2010.02.24 71264
43 Warning: Unknown: open(, O_RDWR) failed: No such file ... ADMINPLAY 2010.01.29 19770
42 register_globals 에 따른 서버 변수형 변환 ADMINPLAY 2010.01.09 17875
41 register_globals = off 란? ADMINPLAY 2010.01.09 15550
40 4.1.0이상 php 버전에서 register_globals = Off 일때 기... ADMINPLAY 2010.01.09 15437
39 PHP FreeTDS 사용 (MS-SQL) file ADMINPLAY 2010.01.05 16944
38 Fatal error: Call to undefined function domxml_open_mem() ADMINPLAY 2009.12.31 17350
37 pear 1.9 업그레이드 및 패치설치 ADMINPLAY 2009.12.31 17322
36 PEC HTTP Setup ADMINPLAY 2009.12.31 15937
35 PHP.INI에서의 세션 관련설명 ADMINPLAY 2009.10.19 17517
34 Maximum execution time of 30 seconds exceeded ADMINPLAY 2009.09.28 17386
33 php세션정리 ADMINPLAY 2009.09.19 17193
32 Warning: flock(): supplied argument is not a valid str... ADMINPLAY 2009.09.09 16767
31 PHPMyAdmin - blowfish_secret 해결방법 ADMINPLAY 2009.09.08 16494
30 php컴파일에러(flex) configure: error: cannot find out... ADMINPLAY 2009.08.08 16108
29 PHP - eAccelerator 설치 ADMINPLAY 2009.08.03 15017
Board Pagination Prev 1 2 3 Next
/ 3

Copyright ADMINPLAY corp. All rights reserved.

abcXYZ, 세종대왕,1234

abcXYZ, 세종대왕,1234