이 순서는 가장 마지막이어야 한다.

PHP 설치는 Apache, Mysql 이 설치된 이후에 하도록 한다.

 

1) Apache 설치방법

2) Mysql  설치방법

 

1. extension 에 사용할 파일들을 먼저 설치해 보자.

 

1
yum install bzip2-devel curl-devel gmp-devel libxslt-devel openldap-devel libicu-devel sqlite-devel oniguruma-devel
cs

 

2. libmcrypt 를 설치한다 [다운로드 바로가기]

 

1
2
$ ./configure --libdir=/lib64
$ make && make install
cs

 

3. libzip을 설치한다.

   굉장히 많은 시도를 해봤다.

    yum 으로 설치하면 0.10 버전이기 때문에 php7 설치가 안된다. 소스설치를 하면 1.5 버전이긴 하지만, 컴파일 및 메이크 시 에러가 많이난다.

    그래서 딱 맞는 0.11 버전 RPM 버전을 찾았다. centos7 64bit 용이다.

     

libzip-0.11.2.zip
다운로드

 

     위 파일을 다운로드 받고 서버로 보낸다.

 

1
2
$ rpm -ivh libzip-0.11.2-6.el7.psychotic.x86_64.rpm
$ rpm -ivh libzip-devel-0.11.2-6.el7.psychotic.x86_64.rpm
cs

 

   (libzip 최신 버전 설치법을 포스팅했다)

2019/07/02 - [Issue] - libzip 최신버전 설치하기

 

 

4. 사전준비는 끝났다. 이제 설치를 한다.

    PHP 소스파일을 다운받고 압축 푼 곳으로 이동하여 아래 명령어를 실행한다.

 

1
./configure --prefix=/apps/php-7.2.8 --with-apxs2=/apps/httpd-2.4.34/bin/apxs --with-mysqli --with-zlib --with-zlib-dir=/usr --with-jpeg-dir=/usr --with-png-dir=/usr --with-freetype-dir=/usr --with-libxml-dir=/usr --with-gd --with-gettext --with-curl --with-bz2=/usr --with-gmp --with-iconv --with-mhash --with-xmlrpc --with-xsl --with-kerberos --with-openssl=/usr/local/openssl --with-openssl-dir=/usr/local/openssl --enable-pdo --enable-shmop --enable-soap --enable-sockets --enable-wddx --enable-ctype --enable-debug --enable-sockets --enable-calendar --enable-sysvsem=yes --enable-ftp --enable-inline-optimization --enable-bcmath --enable-exif --enable-mbstring --enable-json --enable-zip --with-libzip=/usr/lib64 --with-ldap=/usr/lib64 --with-ldap-sasl --with-pdo-mysql --enable-maintainer-zts
cs

 

 

 

    설치를 편하게 하는 컴파일 실행파일 을 올려두긴 하겠다.  

run.sh
다운로드

 

 

 

- ldap.h 관련 에러 발생 시

1
ln -/usr/include/ldap.h /usr/lib64/ldap.h
cs

 

 

- off_t undefined; check your library configuration 발생 시 

1
2
3
4
$ vim /etc/ld.so.conf
 
(맨 하단 줄에)
/usr/local/lib64
 
(wq로 종료 후)
$ ldconfig
cs

 

 

- collect2: ld returned 1 exit status 에러 발생 시

yum install libtool-ltdl-devel

 

'기억할것들 > PHP' 카테고리의 다른 글

php-oracle 연동  (0) 2020.02.24
centos7 php-7 mssql 연결  (0) 2019.12.10
[CSS] 로 문자열 줄임 처리하기  (0) 2018.08.29
구글 영수증 검증  (0) 2018.07.25

+ Recent posts