■ 필요한 패키지 설치

1. php 설치에 따른 필요한 라이브러리 먼저 설치.

( 그 외에 필요한 패키지는 설치하시면서 추가로 설치 부탁드립니다.)

# yum -y install epel-release
# yum -y install sqlite-devel libcurl-devel oniguruma-devel  

# cd /usr/local/src; wget https://libzip.org/download/libzip-1.7.3.tar.gz
# tar zxvf libzip-1.7.3.tar.gz
# cd $SOURCE/libzip-1.7.3
# cmake3 -DCMAKE_INSTALL_PREFIX=/usr/local/libzip-1.7.3
# make; make install

 

2. 설치에 필요한 파일 설치.

# cd /usr/local/src/; wget https://www.php.net/distributions/php-7.4.28.tar.gz
# tar zxvf php-7.4.28.tar.gz

 

■ PHP 컴파일 및 설치

export PKG_CONFIG_PATH=/usr/local/libzip-1.7.3/lib64/pkgconfig
# cd php-7.4.28
# ./configure  --with-apxs2=/usr/local/httpd2/bin/apxs \
--with-mysql-sock=/tmp/mysql.sock \
--with-mysqli=mysqlnd \
--with-pdo-mysql=mysqlnd \
--enable-gd --with-freetype \
--with-jpeg \
--with-zlib \
--enable-ftp \
--disable-debug \
--enable-sockets \
--with-gettext \
--enable-shared \
--with-gdbm \
--with-kerberos \
--with-mhash \
--with-libxml=/usr/local \
--with-xmlrpc \
--enable-dom \
--with-iconv=/usr/local/iconv \
--with-curl=/usr/local/curl \
--enable-mbstring \
--enable-sysvsem \
--enable-sysvshm \
--enable-sysvmsg \
--with-xsl \
--with-openssl \
--enable-soap \
--with-zip \
--enable-bcmath
# make; make install

 

■ PHP 컴파일 설치 시 주의사항

PHP 7.4 버전을 설치하면서 변경되거나 사라진 옵션들이 있으니 참고 바랍니다.

--enable-zip => --with-zip
--wtih-freetype-dir => --with-freetype
--with-gd => --enable-gd
--wtih-jpeg-dir => --with-jpeg
-- with-libxml-dir => --with-libxml
--with-png-dir => --with-png 

 

[참고자료]

https://www.php.net

+ Recent posts