SEn/linux

Centos 7 APM 설치(php)

SEn123 2020. 7. 20. 19:37

wget을 이용하여 소스 파일을 다운받고 tar -xvf 로 압축을 해제한다.

 

[root@localhost ~]# cd /usr/local/src

[root@localhost src]# cd php-7.4.7

[root@localhost php-7.4.7]# ./configure  --prefix=/usr/local/php --with-mysql=/home/mysql --with-apxs2=/usr/local/apache/bin/apxs --with-mysqli=/home/mysql/bin/mysql_config --with-gd --with-curl --with-jpeg-dir=/usr --with-freetype-dir=/usr --with-png-dir=/usr/lib64 --with-xpm-dir=/usr/lib64 --with-zlib --with-zlib-dir=/usr --with-gdbm --with-gettext --with-iconv --with-openssl --enable-gd-native-ttf --enable-exif --enable-sockets --enable-soap --enable-mbstring --enable-mbregex --enable-exif --enable-bcmath --with-libxml-dir=/usr/lib --with-xmlrpc --enable-ftp --with-mcrypt

 

[root@localhost php-7.4.7]# make && make install

----------------------------------------------------------------------------------------------------------------

configure : error: xml2-config not found. Please check your libxml2 insyutallation

# yum -y install libxml2-devel

 

Configure: error: Please reinstall the libcurl distribution - easy.h should be in <curl-dir>/include/curl/

# yum -y install curl-devel

 

mcrypt 에러

# yum -y install libmcrypt-devel libmcrypt

 

freetype 에러 configure: error: freetype-config not found.

# yum -y install freetype-devel

 

checking for QDBM support... no
configure: error: DBA: Could not find necessary header file(s).

# yum -y install gdbm gdbm-devel

----------------------------------------------------------------------------------------------------------------

 

[root@localhost php-7.4.7]# cp php.ini-development /usr/local/php/lib/php.ini

[root@localhost php-7.4.7]# cd /usr/local/php/lib

[root@localhost lib]# vi php.ini

----------------------------------------------------------------------------------------------------------------

;date.timezone => date.timezone= Asia/Seoul 로 변경

----------------------------------------------------------------------------------------------------------------

 

-memcache 설치-

php7 하위 버전

[root@localhost lib]# ./usr/local/php/bin/pecl install memcache

yes

 

Build process completed successfully

Installing '/usr/local/php/lib/php/extensions/no-debug-non-zts-20100525/memcache.so'

install ok: channerl://pecl.php.net/memcache-2.2.7

configuration option "php.ini"is not set to php.ini location

you should add "extension=memcache.so" to php.ini

 

[root@localhost lib]# vi php.ini

----------------------------------------------------------------------------------------------------------------

하단 부에

[memcache]

extension=memcache.so

----------------------------------------------------------------------------------------------------------------

 

 

상위버전

라이브러리 설치

[root@localhost lib]# yum install libmemcached libmemcached-devel

[root@localhost lib]# cd /usr/local/src

https://code.google.com/archive/p/memcached/downloads 에서 memcache wget으로 받아오고

tar -xvf 로 압축해제

 

[root@localhost src]# cd memcache-1.4.15

[root@localhost src]# ./configure --prefix=/usr/local/memcached --enable-64bit 

[root@localhost src]# make && make install

[root@localhost src]# cd /usr/local/memcached/bin

[root@localhost memcached]# ./memcached -vv -d -m 500 -u root -p 11211

[root@localhost memcached]# cd /usr/local/php/lib

[root@localhost lib]# vi php.ini

----------------------------------------------------------------------------------------------------------------

하단 부에

[memcache]

extension=memcache.so

memcache.allow_failover =1

memcache.max_failover_attempts = 20

memcache.chunk_size = 8182

memcache.default_port = 11211

----------------------------------------------------------------------------------------------------------------

 

php 7버전에선 Zend Opcache가 포함되어 설치된다고 한다. (오호~ Zend Guard loader가 설치가 안돼 진땀뺐다;;;)

 

[root@localhost memcached]# cd /usr/local/php/lib

[root@localhost lib]# vi php.ini

--------------------------------------------------------------------------------------------------------------

[opcache]
zend_extension=/usr/local/php/lib/php/extensions/no-debug-zts-20151012/opcache.so
opcache.memory_consumption=128
opcache.interned_strings_buffer=8
opcache.max_accelerated_files=4000
opcache.revalidate_freq=60
opcache.fast_shutdown=1
opcache.enable_cli=1

--------------------------------------------------------------------------------------------------------------

[root@localhost lib]# systemctl restart httpd