1. php 다운로드 및 압축 해제

wget <https://www.php.net/distributions/php-7.2.33.tar.gz>
tar zxvf php-7.2.33.tar.gz
cd php-7.2.33

2. php 설치

./configure --prefix=/usr/local/php-7.2.33 --with-apxs2=/usr/local/apache2.4.43/bin/apxs --with-config-file-path=/etc --with-pdo-mysql=/usr/local/mysql --enable-soap --enable-mbstring --with-gd=shared --with-gd --with-jpeg-dir --enable-sockets --with-openssl --with-zlib --with-gettext --enable-sigchild --with-iconv --with-libxml-dir --with-png-dir --enable-opcache --enable-fpm --with-fpm-user=apache --with-fpm-group=apache --with-freetype-dir --with-curl --enable-exif --enable-zip --enable-bcmath --enable-mbstring=all --with-mysqli=/usr/local/mysql/bin/mysql_config

make
make install

3. 환경 변수 등록

vi /etc/profile

#php PATH
php=/usr/local/php-7.2.33
export PATH=$PAHT:$php/bin:$php/sbin
:wq

source /etc/profile

4. php 버전 확인

php --version