OS | Apache Ver | MPM | PHP Ver | Curl Ver |
---|---|---|---|---|
CentOS 7 | 2.4.58 | Worker | 5.2.17 | 7.29.0 |
apachectl -V Server version: Apache/2.4.58 (Unix) Server built: Nov 6 2023 11:40:21 Server's Module Magic Number: 20120211:129 Server loaded: APR 1.7.4, APR-UTIL 1.6.3, PCRE 8.32 2012-11-30 Compiled using: APR 1.7.4, APR-UTIL 1.6.3, PCRE 8.45 2021-06-15 Architecture: 64-bit Server MPM: worker threaded: yes (fixed thread count) forked: yes (variable process count) Server compiled with.... -D APR_HAS_SENDFILE -D APR_HAS_MMAP -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled) -D APR_USE_PROC_PTHREAD_SERIALIZE -D APR_USE_PTHREAD_SERIALIZE -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT -D APR_HAS_OTHER_CHILD -D AP_HAVE_RELIABLE_PIPED_LOGS -D DYNAMIC_MODULE_LIMIT=256 -D HTTPD_ROOT="/usr/local/apache_2.4" -D SUEXEC_BIN="/usr/local/apache_2.4/bin/suexec" -D DEFAULT_PIDLOG="logs/httpd.pid" -D DEFAULT_SCOREBOARD="logs/apache_runtime_status" -D DEFAULT_ERRORLOG="logs/error_log" -D AP_TYPES_CONFIG_FILE="conf/mime.types" -D SERVER_CONFIG_FILE="conf/httpd.conf"
php -v PHP 5.2.17 (cli) (built: Nov 6 2023 12:01:07) Copyright (c) 1997-2010 The PHP Group Zend Engine v2.2.0, Copyright (c) 1998-2010 Zend Technologies with Zend Extension Manager v1.2.2, Copyright (c) 2003-2007, by Zend Technologies with Zend Optimizer v3.3.3, Copyright (c) 1998-2007, by Zend Technologies
php -i | grep curl -A3 cURL support => enabled cURL Information => libcurl/7.59.0 OpenSSL/1.0.2k zlib/1.2.7
Configure Option
'./configure' \ '--prefix=/usr/local/php' \ '--with-apxs2=/usr/local/apache/bin/apxs' \ '--enable-cgi' \ '--enable-fastcgi' \ '--enable-force-cgi-redirect' \ '--enable-discard-path' \ '--with-config-file-path=/usr/local/apache/conf' \ '--enable-bcmath' \ '--enable-mod-charset' \ '--with-iconv-dir' \ '--with-mime-magic' \ '--with-libxml-dir' \ '--with-xmlrpc' \ '--with-openssl' \ '--with-pcre-dir=/usr/local/pcre_8.45' \ '--with-zlib' \ '--with-zlib-dir' \ '--with-bz2' \ '--enable-calendar' \ '--enable-ctype' \ '--with-curl' \ '--enable-dba' \ '--enable-dbase' \ '--with-pspell' \ '--with-dbm' \ '--enable-ftp' \ '--with-gd' \ '--enable-gd-native-ttf' \ '--enable-gd-jis-conv' \ '--with-gdbm' \ '--with-jpeg-dir' \ '--with-png-dir' \ '--with-ttf' \ '--with-freetype-dir' \ '--with-t1lib' \ '--enable-shmop' \ '--with-gettext' \ '--with-gmp' \ '--with-imap' \ '--with-imap-ssl' \ '--with-kerberos' \ '--enable-mbstring' \ '--with-libmbfl' \ '--with-mhash' \ '--with-mcrypt' \ '--enable-sockets' \ '--with-regex=php' \ '--enable-mbregex' \ '--enable-sysvmsg' \ '--enable-sysvsem' \ '--enable-sysvshm' \ '--with-ldap' \ '--enable-soap' \ '--with-ldap-sasl' \ '--with-ncurses' \ '--with-tidy' \ '--with-xsl' \ '--enable-wddx' \ '--enable-zend-multibyte' \ '--enable-zip' \ '--enable-exif' \ '--enable-pcntl' \ '--enable-sigchild' \ '--enable-posix' \ '--enable-magic-quotes' \ '--enable-libgcc' \ '--with-mysql=/usr/local/mysql' \ '--with-pdo-mysql' \ '--with-mysqli' \ '--enable-libxml' \ '--with-readline' \ '--with-libedit' \ '--enable-session' \ '--enable-simplexml' \ '--enable-xml' \ '--enable-reflection' \ '--with-pcre-regex' \ '--enable-filter' \ '--with-xpm-dir' \ '--enable-xmlwriter' \ '--enable-xmlreader' \ '--enable-tokenizer' \ '--enable-safe-mode' \ '--disable-debug' \ '--enable-zend-multibyte' \ '--with-mysql-sock=/tmp/mysql.sock' \ '--enable-maintainer-zts' \ '--enable-zts' \
설치 방식 | 기존 Ver | 신규 Ver |
---|---|---|
Source Install | 2.2.23 (Worker) | 2.4.58 (Worker) |
Apache 2.2와 2.4의 source install configure 옵션 및 설치 시 루틴이 달라 재컴파일만으로는 불가
증상 : smshub 기능이 안되는 현상 발생
원인 : curl (libcurl) 버전이 7.59.0 이상으로 해야 통신이 가능하나 CentOS 7 기본 curl 버전이 7.29.0 이기 때문에 버전이 맞지 않아 발생
curl 7.59.0 Source Install 후 php configure option에 --with-curl
부분에 해당 소스 설치 디렉토리 입력하고 컴파일하여 설치
curl 7.59.0 설치 파일
https://curl.se/download/curl-7.59.0.zip
export LD_LIBRARY_PATH=/usr/local/curl_7.59.0:$LD_LIBRARY_PATH
echo $LD_LIBRARY_PATH
vi /etc/ld.so.conf
/usr/local/curl_7.59.0 # 삽입 후 저장
ldconfig
mv /usr/bin/curl /usr/bin/curl_ori
mv /usr/include/curl /usr/include/curl_ori
ln -s /usr/local/curl_7.59.0/bin/curl /usr/bin/curl
ls -al /usr/bin/curl
mkdir /usr/lib64/libcurl_ori
mv /usr/lib64/libcurl.so* /usr/lib64/libcurl_ori/
cp -a /usr/local/curl_7.59.0/lib/libcurl.* /usr/lib64/
vi /etc/yum.repos.d/city-fan.repo
---
[CityFan]
name=City Fan Repo
baseurl=http://www.city-fan.org/ftp/contrib/yum-repo/rhel$releasever/$basearch/
enabled=1
gpgcheck=0
---
yum install -y curl
curl -V
현재 최신 city-fan curl 버전이 8 버전 대이므로 8 버전이 설치됨
# 기존 php 경로에서 참조하는 curl 확인
ldd /기존php경로/bin/php | grep curl
libcurl.so.4 => /usr/local/lib/libcurl.so.4 (0x00007f06a3d48000)
# 신규 php 경로에서 참조하는 curl 확인
ldd /usr/local/php/bin/php | grep curl
libcurl.so.4 => /usr/kerberos/lib/libcurl.so.4 (0x00007f890fefc000)
# /usr/kerberos/lib/libcurl.so.4 백업
mv /usr/kerberos/lib/libcurl.so.4 /usr/kerberos/lib/libcurl.so.4_ori
# 신규 php 경로에서 참조하는 curl 재확인
ldd /usr/local/php/bin/php | grep curl
libcurl.so.4 => /usr/local/lib/libcurl.so.4 (0x00007f06a3d48000)
# php 옵션으로 확인
php -i | grep libcurl
cURL Information => libcurl/7.59.0 OpenSSL/1.0.2k zlib/1.2.7