PHP 설치

서버/리눅스 2013. 3. 17. 16:48
반응형

http://www.php.net 에서 wget 이용 다운로드

./configure --help | grep 명령어
로 현재 운용가능한 명령어를 확인할 수 있다. 되지 않는 옵션도 있으니 빼도록 하자.

--prefix=/usr/local/APM/php \ 
--with-apxs2=/usr/local/APM/apache/bin/apxs \ : 아파치의 apxs 를 이용해 아파치에 모듈을 적재
--with-mysql=/usr/local/APM/mysql \ : MYSQL과 연동한다
--with-config-file-path=/usr/local/APM/apache/conf \ : php의 환경설정파일인 php.ini가 생성될 위치를 지정한다.
MYSQL, APACHE와 연동

--enable-sockets \
--with-mod_charset \
--with-charset=utf8 \

-----------------------------------------------------
아래는 각종 라이브러리를 포함하는 옵션들이다.
--with-xml \
--with-language=korean \
--enable-sysvsem=yes \
--enable-sysvshm=yes \
--enable-ftp \
--enable-magic-quotes \
--enable-gd-native-ttf \
--enable-inline-optimization \
--enable-bcmath \
--with-jpeg \
--with-png \
--with-zlib \
--with-jpeg-dir=/usr \
--with-png-dir=/usr/lib \
--with-freetype-dir=/usr \

--with-libxml-dir=/usr \

--with-gd \
------------------------------------------------------

--enable-sigchild \

--enable-mbstring

 

 

make && make install

 

※ 환경설정

php.ini-(버전별로다름 보통 php.ini-devel~~) 

파일을 configure 했을때 경로로 복사해준다

--with-config-file-path=경로 로


아파치와의 연동을 위해 httpd.conf 파일을 수정한다.

DirectoryIndex에 index.php 추가

mime_module 항목에 .php 를 php로 인식할 수 있게 

AddType 지시어를 이용하여 설정한다.

AddType application/x-httpd-php .php

AddType application/x-httpd-php-source .phps

를 추가후 아파치 재시작

 

./configure 시에 lex: command not found 오류

: # yum install flex

 

php 구버전 make 컴파일시 ext/libxml/libxml.lo 오류

: vi Zend/zend_modules.h 를 열어

: #include "zend.h" 밑에

  #include "zend_compile.h" 를 추가해준다

 

'서버 > 리눅스' 카테고리의 다른 글

sendmail 설치  (0) 2013.03.21
proftpd 설치  (0) 2013.03.17
apache(httpd) 설치  (0) 2013.03.17
MYSQL 설치 (Ver.5.6.10)  (0) 2013.03.17
CMAKE 설치 전 필요 라이브러리  (0) 2013.03.17
Posted by 마광2
,