OS

2022.02.14 15:48

php 7.4.12 버전 컴파일

  • 비아웹 오래 전 2022.02.14 15:48 인기
  • 5,346
    0

1. 테스트 환경

OS : CentOS Linux release 7.6.1810 (Core)

SELINUX : disabled

openssl : 1.1.1h 컴파일 설치

apache : 2.4.41 컴파일 설치

mysql : 5.7.31 컴파일 설치

테스트 일자 : 2020.11.13

 

2. 소스 다운로드

[root@viaweb source]# wget https://www.php.net/distributions/php-7.4.12.tar.gz [root@viaweb source]# wget https://libzip.org/download/libzip-0.11.tar.gz
[root@viaweb source]# wget https://github.com/unicode-org/icu/releases/download/release-51-3/icu4c-51_3-src.tgz

3. 의존성 패키지 설치 

[root@viaweb source]# yum install epel-release

[root@viaweb source]# yum install libtidy-devel libxml2-devel bzip2-devel curl-devel krb5-devel gdbm-devel libmcrypt-devel unixODBC-devel gd-devel freetype-devel sqlite-devel aspell-devel libedit-devel libxslt-devel gmp-devel libtidy-devel 

[root@viaweb source]# rpm -Uvh  http://www6.atomicorp.com/channels/atomic/centos/7/x86_64/RPMS/oniguruma-5.9.5-3.el7.art.x86_64.rpm

[root@viaweb source]# rpm -Uvh http://www6.atomicorp.com/channels/atomic/centos/7/x86_64/RPMS/oniguruma-devel-5.9.5-3.el7.art.x86_64.rpm 

 


 

4. libzip 설치

[root@viaweb source]# tar -zxvpf libzip-0.11.tar.gz [root@viaweb source]# cd libzip-0.11
[root@viaweb libzip-0.11]# ./configure --prefix=/usr/local/libzip [root@viaweb libzip-0.11]# make && make install
[root@viaweb libzip-0.11]# cp libzip.pc /usr/lib64/pkgconfig/
[root@viaweb libzip-0.11]# cp /usr/local/mysql/lib/pkgconfig/mysqlclient.pc /usr/lib64/pkgconfig/
[root@viaweb libzip-0.11]# ln -s /usr/local/mysql/lib/libmysqlclient.a /usr/local/mysql/lib/libmysqlclient_r.a

5. icu4c 설치

[root@viaweb source]# tar -zxvpf icu4c-51_3-src.tgz [root@viaweb source]# cd icu/source/[root@viaweb source]# ./configure --prefix=/usr/local/icu [root@viaweb source]# make && make install [root@viaweb source]# cp config/*.pc /usr/lib64/pkgconfig/

6. php 컴파일

[root@viaweb source]# tar -zxvpf php-7.4.12.tar.gz [root@viaweb source]# cd ./php-7.4.12
## configure: error:DBA: Could not find necessary library. 에러 방지 ln -s /usr/lib64/libgdbm_compat.so /usr/local/lib64/libdbm.so
exportPKG_CONFIG_PATH=/usr/local/openssl/lib/pkgconfig ./configure --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-mysqli=/usr/local/mysql/bin/mysql_config \ --with-mysql-sock=/tmp/mysql.sock \ --with-jpeg \ --with-libedit \ --with-mhash \ --with-zip \ --with-libxml \ --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-xmlrpc \ --with-xpm \ --with-xsl \ --with-zlib \ --with-zlib-dir=/usr \ --enable-bcmath \ --enable-calendar \ --enable-ctype \ --enable-dba=shared \ --enable-dom \ --enable-exif \ --enable-gd \ --enable-gd-jis-conv \ --enable-inline-optimization \ --enable-intl \ --enable-maintainer-zts \ --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

7. make && make install

8. 환경 설정

[root@viaweb php-7.4.12]# cp php.ini-production /usr/local/apache/conf/php.ini [root@viaweb php-7.4.12]# sed -i "s/short_open_tag = Off/short_open_tag = On/g"/usr/local/apache/conf/php.ini

9. apache 환경 설정

[root@viaweb php-7.4.12]# vi /usr/local/apahce/conf/extra/php.conf # php.conf # Cause the PHP interpreter to handle files with a .php extension. AddHandler php5-script .php AddHandler php7-script .php 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 line to allow PHP to pretty-print .php files asPHP source code: AddType application/x-httpd-php .php .html AddType application/x-httpd-phps .phps AddType application/x-httpd-php3 .php3 .phtml
[root@viaweb php-7.4.12]# echo "Include conf/extra/php.conf">>/usr/local/apache/conf/httpd.conf

10. apache restart 및 phpinfo 확인

 

감사합니다.

서버호스팅 비아웹


 

  • 공유링크 복사
  • 이전글apache2.4 mod_cband 연동2022.02.14
  • 다음글apache 2.4.41 complie 설치2022.02.14
  • 댓글목록

    등록된 댓글이 없습니다.