📚 [ubuntu] Apache + php5.2 설치하기

Category: PHP | 📅 July 05, 2016

Install Apache


$./configure --prefix=/usr/local/httpd \
 --enable-module=so \
 --with-mpm=worker \
 --enable-dav \
 --enable-so \
 --enable-rewrite \
 --enable-dav=shared \
 --enable-dev-fs=shared \
 --with-included-apr

$sudo make $ sudo make install

Install PHP

다운로드는 php사이트에 다운 받았다 치고

$ sudo ./configure --prefix=/usr/local/php \
 --with-apxs2=/usr/local/httpd/bin/apxs \
 --with-zlib \
 --with-gd \
 --with-ttf \
 --with-expat-dir=/usr/lib64/mysql \
 --with-xml \
 --with-charset=utf_8 \
 --with-config-file- \
 --with-iconv \
 --with-curl \
 --with-xml2 \
 --with-xpm-dir=/usr \
 --with-jpeg-dir=/usr/lib64 \
 --with-libdir=lib64 \
 --with-freetype-dir=/usr/lib64 \
 --with-mysql=/usr/lib64/mysql \
 --disable-debug \
 --disable-rpath \
 --enable-mailparse \
 --enable-safe-mode \
 --enable-magic-quotes \
 --enable-bcmath \
 --enable-dio \
 --enable-gd-native-ttf \
 --enable-sysvsem \
 --enable-sysvshm \
 --enable-wddx \
 --enable-pic \
 --enable-inline-optimization \
 --enable-mbstring \
 --enable-mbregex \
 --enable-mbstr-enc-trans \
 --enable-ftp \
 --enable-track-vars=yes \
 --enable-dl \
 --enable-gd-imgstrttf \
 --enable-soap

 $sudo make
 $sudo make install

prefix , jpeg-dir 등의 경로는 적당히 수정한다.

Configure 옵션 별 관련 패키지 설치

$sudo apt-get install libxml2 libxml2-dev
$sudo apt-get install libz-dev libbz2-dev
$sudo apt-get install curl libcurl-openssl-dev
$sudo apt-get install libpng-dev
$sudo apt-get install libjpeg-dev libjpeg62-dev
$sudo apt-get install libXpm-dev
$sudo apt-get install libgmp-dev
$sudo apt-get install libc-client-dev
$sudo apt-get install libmcrypt-dev libmhash-dev
$sudo apt-get install mysql-client libmysqlclient15-dev

이 외에도 컴파일 도중 에러가 나오면 추가 패키지를 설치해야 하는 경우도 있음.

64비트 관련 에러 처리

$ln -s /usr/lib/x86..../libjpeg.so /usr/lib/libjpeg.so
$mkdir /usr/kerberos
$ln -s /usr/lib/x86... /usr/kerberos/lib
$ln -s /usr/lib64/libmysqlclient.so /usr/libmysqlclient.so
$ln -s /usr/lib64/libmysqlclient.so /usr/lib/mysql/libmysqlclient.so
🏷️ Tags
  • #PHP  
  • #ubuntu  
  • #linux  
  • #install-php