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 파일을 생성해줌~ 푸힛

List of Articles
번호 제목 글쓴이 날짜 조회 수
48 Ubuntu 에서 PHP Screw 컴파일시 에러날 때 ADMINPLAY 2013.09.07 6972
47 php.ini 설명 ADMINPLAY 2009.06.04 7383
46 PHP 업로드 용량 제한 변경하기 #2 ADMINPLAY 2008.11.03 7446
45 세션관련 설명입니다 ADMINPLAY 2009.05.13 7623
44 PHP 업로드 용량 제한 변경하기 #1 ADMINPLAY 2008.11.03 8031
43 php 버전 정보 숨기기 ADMINPLAY 2009.06.04 8131
42 Warning: main(): URL file-access is disabled in the se... ADMINPLAY 2009.06.04 8235
41 call undefined mysql connect 에러 발생시 해결 방안 ADMINPLAY 2009.06.04 8430
» php 재 컴파일 없이 필요한 모듈 올리기 1 ADMINPLAY 2008.12.14 8736
39 DB 관리 : phpmyadmin ADMINPLAY 2008.12.10 8778
38 php mysql에 insert시 싱글쿼츠(홑따옴표) 입력 처리 (mag... ADMINPLAY 2013.09.07 8909
37 call undefined mysql connect 와 같은 mysql 라이브러리... ADMINPLAY 2009.06.04 9014
36 Fedora 및 CentOs 에서 Imap PHP 연동시 에러가날때 ADMINPLAY 2009.06.01 9059
35 DBA: Could not find necessary header file 발생시 대처법 ADMINPLAY 2009.06.04 9249
34 [php모듈] php 소스 암호화 하기 - php_screw-1.5 file ADMINPLAY 2013.03.26 9528
33 freetds 설치 (php로 외부 MS-SQL 서버에 접속 사용하기) ADMINPLAY 2009.05.18 9595
32 php.ini 옵션 한글설명 ADMINPLAY 2009.07.18 9626
31 PHPMyAdmin 오류조치법 Your PHP MySQL library version ... ADMINPLAY 2009.01.20 10021
30 ini_set("allow_url_fopen", 1); -- allow_url_fopen = Of... ADMINPLAY 2009.06.01 10124
29 php 명령어 이용 phpinfo 확인 ADMINPLAY 2009.06.04 10236
Board Pagination Prev 1 2 3 Next
/ 3

Copyright ADMINPLAY corp. All rights reserved.

abcXYZ, 세종대왕,1234

abcXYZ, 세종대왕,1234