OS

2024.06.28 11:48

php curl openssl 연동

  • 비아웹 오래 전 2024.06.28 11:48 인기
  • 143
    0

안녕하세요

서버호스팅 전문기업 비아웹입니다.

 

php 로 이루어진 웹 서비스를 운영하다 보면 PG사 결제 연동시에 curl 에 openssl 이 연동이 필요한 경우가 있습니다.

기존에 컴파일된 php에서 curl 만 openssl 연동 하는 부분에 대해 정리합니다.

 

해당 테스트는 CentOS 7 에서 진행되었으며, https://blog.naver.com/viaweb/222851720101 테스트와 연결되어 있습니다.

 

1. 일반적인 컴파일 옵션에서 phpinfo 의 curl 출력 화면

  • 이전 포스트인 php 8 버전의 phpinfo 화면 중

    op05.JPG

 

2. curl 컴파일

- openssl, http2, libssh2, nss 지원

# wget https://curl.se/download/curl-7.84.0.tar.gz

압축해제 

# ./configure --prefix=/usr/local/curl --with-openssl=/usr/local/openssl \

--with-nghttp2 --with-libssh2 --with-nss-deprecated

# make && make install

 op06.JPG

  • pkgconfig 처리

# mv /lib64/pkgconfig/libcurl.pc  /lib64/pkgconfig/libcurl.pc_old 

# ln -s /usr/local/curl/lib/pkgconfig/libcurl.pc /lib64/pkgconfig/


# cd /usr/lib64

# mkdir libcurl

# mv libcurl.* libcurl/

# ln -s /usr/local/curl/lib/libcurl.* /lib64/


3. phpinfo 화면 확인op09.JPG

감사합니다.

서버호스팅 비아웹

  • 공유링크 복사

    댓글목록

    등록된 댓글이 없습니다.