CentOS 7 에서 httpd 2.4.51, PHP 8.0 소스 설치하기

리눅스/APACHE|2021. 12. 7. 14:47
반응형

1. httpd 관련 패키지 설치

# yum -y install gcc gcc-c++  libtermcap-devel gdbm-devel zlib* libxml* freetype* libjpeg* gd-* 

# yum -y install libpng* --skip-broken pcre-devel

 

 

2. apr 설치

# cd /usr/local/src

# wget https://archive.apache.org/dist/apr/apr-1.5.2.tar.gz

# tar xvzf apr-1.5.2.tar.gz

# cd apr-1.5.2

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

# make

# make install

 

 

3. apr-util 설치

# cd ..

# wget https://archive.apache.org/dist/apr/apr-util-1.5.4.tar.gz

# tar xvzf apr-util-1.5.4.tar.gz

# cd apr-util-1.5.4

# ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr

# make

# make install

 

 

4. httpd 설치

# cd ..

# wget https://archive.apache.org/dist/httpd/httpd-2.4.51.tar.gz

# tar xvzf 

# cd httpd-2.4.51

# ./configure --prefix=/usr/local/apache --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --enable-rewrite --enable-ssl --enable-so 

# make

# make install

 

 

5. PHP 관련 패키지 설치

# yum -y install sqlite-devel

 

 

6. PHP 설치

# cd ..

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

# tar xvzf php-8.0.12.tar.gz

# cd php-8.0.12.tar.gz

# ./configure --prefix=/usr/local/php --with-mysqli --with-openssl=/usr/local/ssl --with-pdo-mysql=mysqlnd --with-apxs2=/usr/local/apache/bin/apxs --with-config-file-path=/usr/local/apache/conf --with-zlib --disable-debug --enable-calendar --enable-ftp --enable-sockets --enable-sysvsem

# make

# make install

# cp -arp php.ini-production /etc/php.ini

 

 

6. httpd 및 PHP 기본 설정

# vi /usr/local/apache/conf/httpd.conf

ServerName localhost

<Directory /usr/local/apache/htdocs>
        Options FollowSymLinks MultiViews
        AllowOverride All
        Require all granted
</Directory>

 

# vi /etc/php.ini

short_open_tag = On

date.timezone = "Asia/Seoul"

open_basedir = "/usr/local/apache/htdocs"

반응형

댓글()