해당버전에 맞는 oracle client rpm 을 다운로드

 

https://www.oracle.com/database/technologies/instant-client/linux-x86-64-downloads.html

 

Instant Client for Linux x86-64 (64-bit)

Instant Client Installation for Linux x86-64 (64-bit) For general Instant Client information, see the Home Page. ODBC users should follow the ODBC Installation Instructions. Instant Client RPMs are also available without click-through from yum.oracle.com f

www.oracle.com

1. basic

2. devel

3. sqlplus

 

rpm -ivh oracle-instantclient12.2-basic-12.2.0.1.0-1.x86_64.rpm

rpm -ivh oracle-instantclient12.2-devel-12.2.0.1.0-1.x86_64.rpm

rpm -ivh oracle-instantclient12.2-sqlplus-12.2.0.1.0-1.x86_64.rpm

 

autoconf 설치를 진행한다

https://smarthink.tistory.com/39

불러오는 중입니다...

 

pecl 에서 oci-8 다운로드

 

1. phpize

2. ./configure --with-oci8=shared,instantclient,/usr/lib/oracle/12.2/client64/lib

3. ln -s /usr/include/oracle/12.2/client64/ /usr/lib/oracle/12.2/client64/lib/include

4. make && make install

 

php.ini oci8.so 설정

 

oracle instantclient 환경변수 설정

1. splplus 실행을 위한 환경변수 추가

2. vim /etc/profile

3.    export LD_LIBRARY_PATH=/usr/lib/oracle/11.2/client64/lib

       alias sqlplus='/usr/lib/oracle/11.2/client64/bin/sqlplus'

4. 저장 후 source /etc/profile

 

정상연동 확인 명령어

1. php -r "oci_connect();"

2. 명령어를 잘못사용했단 에러문구가 나오면 정상연결

 

3. splplus  실행 후 정상 접속 명령어 나오면 됨

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

centos7 php-7 mssql 연결  (0) 2019.12.10
[CSS] 로 문자열 줄임 처리하기  (0) 2018.08.29
php 7.2.8 소스 설치  (0) 2018.08.13
구글 영수증 검증  (0) 2018.07.25

pdo 이용

 

pecl.php.net 에서

 

PECL :: The PHP Extension Community Library

What is PECL? PECL is a repository for PHP Extensions, providing a directory of all known extensions and hosting facilities for downloading and development of PHP extensions. The packaging and distribution system used by PECL is shared with its sister, PEA

pecl.php.net

sqlsrv, pdo_sqlsrv 다운로드

서버에서 pecl install sqlsrv, pdo_sqlsrv (파일명까지) - gcc 4.7 이상 필요

 

curl https://packages.microsoft.com/config/rhel/7/prod.repo > /etc/yum.repos.d/mssql-release.repo

 

yum install unixODBC-devel mssql-tools

 

c11 무슨 에러 발생하면

wget https://ftp.gnu.org/gnu/gcc/gcc-4.8.2/gcc-4.8.2.tar.gz

tar zxvf gcc-4.8.2.tar.gz

cd gcc-4.8.2

./contrib/download_prerequisites (의존성 파일 다운로드)

./configure --prefix=/usr/local/gcc-4.8.2 --enable-checking=release --enable-languages=c,c++ --disable-multilib

(겁나 오래걸림)

make && make install

 

vim ~/.bashrc

export GCC=/usr/local/gcc-4.8.2 19

export LD_LIBRARY_PATH=$GCC/lib64:$PPL/lib:$LD_LIBRARY_PATH 20

export PATH=$GCC/bin:$PATH

 

php extension 에 sqlsrv, pdo_sqlsrv 추가하고

아파치 재시작

 

 $conn =  new PDO ("sqlsrv:Server=디비주소,$port;Database=디비이름",                               아이디, 비번);

$query = $conn->prepare("SELECT * FROM app");
if ($query->execute()) {
while ($row = $query->fetch(PDO::FETCH_ASSOC)) {
print_r($row);
}
}

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

php-oracle 연동  (0) 2020.02.24
[CSS] 로 문자열 줄임 처리하기  (0) 2018.08.29
php 7.2.8 소스 설치  (0) 2018.08.13
구글 영수증 검증  (0) 2018.07.25

1. 최신버전 다운로드 autoconf available – for me it was 2.69

wget http://ftp.gnu.org/gnu/autoconf/autoconf-latest.tar.gz

 

2.압축풀기 

#tar xzvf autoconf-latest.tar.gz
#cd autoconf-2.69

 

3. 설치하기 
./configure && make && make install

 

Can't locate Data/Dumper 에러 발생 시

yum install perl-Data-Dumper

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

NTP 타임존 자동 동기화  (0) 2020.09.02
centOS 로그인 배너, 메세지 출력  (0) 2020.05.06
SSH 포트 변경하기  (0) 2019.11.28
서비스 자동실행 등록하기  (0) 2019.08.22
libzip 최신버전 설치하기  (0) 2019.07.02

+ Recent posts