OS

2024.06.28 11:17

php 8.1.9 컴파일 설치

  • 비아웹 오래 전 2024.06.28 11:17 인기
  • 154
    0

안녕하세요

서버호스팅 전문기업 비아웹입니다.

이전에 진행한 apache 최신버전 및 openssl 최신 버전 컴파일에 php 최신 버전 컴파일에 대해 정리힙니다.

 

apache 최신 버전 컴파일 정보

https://blog.naver.com/viaweb/222851720101


2. libxml2 컴파일 설치

# yum install python-devel

# wget https://download.gnome.org/sources/libxml2/2.9/libxml2-2.9.14.tar.xz

압축해제

# ./configure --prefix=/usr/local/libxml2    \

            --disable-static \

            --with-history   \

            --with-python=/usr/bin/python

# make 

# make install

 
3. icu 컴파일 설치

# wget https://libzip.org/download/libzip-0.11.tar.gz

압축해제

# ./configure --prefix=/usr/local/libzip

# make && make install

# ln -s /usr/local/libzip/lib/pkgconfig/libzip.pc /lib64/pkgconfig/

 

4. php 컴파일

a. 컴파일 중 DBA 관련 오류 처리

configure: error: DBA: Could not find necessary library.

# ln -s /usr/lib64/libgdbm_compat.so /usr/local/lib64/libdbm.so


checking for QDBM support... no

configure: error: DBA: Could not find necessary header file(s).

 ln -s /usr/lib64/libgdbm_compat.so /usr/local/lib64/libdbm.so


b. 컴파일

# wget https://www.php.net/distributions/php-8.1.9.tar.gz

압축해제

# ./configure LIBXML_CFLAGS=-I/usr/local/libxml2/include LIBXML_LIBS=-L/usr/local/libxml2/lib \

--prefix=/usr/local/php  \

--with-apxs2=/usr/local/apache/bin/apxs \

--with-config-file-path=/usr/local/apache/conf \

--with-bz2 \

--with-curl \

--with-dbm \

--with-freetype \

--with-gdbm \

--with-gettext \

--with-gmp \

--with-iconv \

--with-jpeg \

--with-libedit \

--with-mhash \

--with-zip \

--with-libxml=/usr/local/libxml2 \

--with-expat \

--with-pdo-mysql \

--with-pear \

--with-pic \

--with-pspell \

--with-readline \

--with-openssl \

--with-openssl-dir=/usr/local/openssl \

--with-tidy \

--with-unixODBC=shared,/usr \

--with-xpm \

--with-xsl \

--with-zlib \

--with-zlib-dir=/usr \

--enable-bcmath \

--enable-calendar \

--enable-ctype \

--enable-dba=shared \

--enable-dom \

--enable-exif \

--enable-fpm \

--enable-gd \

--enable-gd-jis-conv \

--enable-intl \

--enable-mbstring \

--enable-mysqlnd \

--enable-opcache=no \

--enable-pcntl \

--enable-shmop \

--enable-sigchild \

--enable-soap \

--enable-sockets \

--enable-sysvmsg \

--enable-sysvsem \

--enable-sysvshm \

--enable-xmlreader \

--enable-xmlwriter \

--with-libdir=lib64


# make 

# make install


mysql 연동 컴파일시 추가 옵션

--with-mysqli=/usr/local/mysql/bin/mysql_config --with-mysql-sock=/tmp/mysql.sock \

 

c. 환경 변수 설정

 
 
# cp php.ini-production /usr/local/apache/conf/php.ini 
# sed -i "s/short_open_tag = Off/short_open_tag = On/g"/usr/local/apache/conf/php.ini

 

d. apache 연동

# vi /usr/local/apahce/conf/extra/php.conf

<FilesMatch \.php$>

    SetHandler application/x-httpd-php

</FilesMatch>


#

# Allow php to handle Multiviews

#

AddType text/html .php


#

# Add index.php to the list of files that will be served as directory

# indexes.

#

DirectoryIndex index.php


#

# Uncomment the following lines to allow PHP to pretty-print .phps

# files as PHP source code:

#

#<FilesMatch \.phps$>

#    SetHandler application/x-httpd-php-source

#</FilesMatch>


#  echo "Include conf/extra/php.conf" >> /usr/local/apache/conf/httpd.conf

 

5. phpinfo 결과 화면

op08.JPG

 

감사합니다.

서버호스팅 비아웹 

  • 공유링크 복사
  • 이전글php curl openssl 연동2024.06.28
  • 다음글apache 2.4.54 / openssl 1.1.1q 설치2024.06.28
  • 댓글목록

    등록된 댓글이 없습니다.