PEAR.php 설치방법 및 사용법 > PHP
PHP

PEAR.php 설치방법 및 사용법

조회 140회 댓글 0건

파일은 없는데 아래와 같은 형태로 읽혀 들이는 것이 있다면 pear이 설치 되어 있는지 확인해 봐야 한다. 

아래쪽에 보면 find명령으로 찾는것이 있으니 참고하면 된다. 


require_once 'PEAR.php';



그래서 이 프로그램은 어떤 프로그램인가 궁금할 수도 있는데 예를 들면 아래와 같은 mime 처리 해주는 라이브러리가 있는데 PEAR.php 기반 위에 만들어진것이다.

즉 PEAR.php 땅 위에 mime가 올라가 있는것이라 생각하면 된다.

PEAR는 재사용 가능한 PHP 구성 요소를 위한 프레임워크 및 배포 시스템입니다.

https://pear.php.net/manual/en/package.mail.mail-mime.php



1) 설치파일 다운로드 받기

wget --no-check-certificate https://pear.php.net/go-pear.phar


2) PEAR.php 설치방법

/usr/local/php83/bin/php go-pear.phar

위 실행하면 아래와 같은 글자들을 볼 수 있는데 엔터를 치면 설치가 된다. 



Below is a suggested file layout for your new PEAR installation.  To

change individual locations, type the number in front of the

directory.  Type 'all' to change all of them or simply press Enter to

accept these locations.


 1. Installation base ($prefix)                   : /opt/remi/php83/root/usr

 2. Temporary directory for processing            : /tmp/pear/install

 3. Temporary directory for downloads             : /tmp/pear/install

 4. Binaries directory                            : /opt/remi/php83/root/usr/bin

 5. PHP code directory ($php_dir)                 : /opt/remi/php83/root/usr/share/pear

 6. Documentation directory                       : /opt/remi/php83/root/usr/docs

 7. Data directory                                : /opt/remi/php83/root/usr/data

 8. User-modifiable configuration files directory : /opt/remi/php83/root/usr/cfg

 9. Public Web Files directory                    : /opt/remi/php83/root/usr/www

10. System manual pages directory                 : /opt/remi/php83/root/usr/man

11. Tests directory                               : /opt/remi/php83/root/usr/tests

12. Name of configuration file                    : /etc/opt/remi/php83/pear.conf



1-12, 'all' or Enter to continue: 


Beginning install...

Configuration written to /etc/opt/remi/php83/pear.conf...

Initialized registry...

Preparing to install...

installing phar:///DATA/server-config/sh/aws_test/Esign/go-pear.phar/PEAR/go-pear-tarballs/Archive_Tar-1.4.14.tar...

installing phar:///DATA/server-config/sh/aws_test/Esign/go-pear.phar/PEAR/go-pear-tarballs/Console_Getopt-1.4.3.tar...

installing phar:///DATA/server-config/sh/aws_test/Esign/go-pear.phar/PEAR/go-pear-tarballs/PEAR-1.10.14.tar...

installing phar:///DATA/server-config/sh/aws_test/Esign/go-pear.phar/PEAR/go-pear-tarballs/Structures_Graph-1.1.1.tar...

installing phar:///DATA/server-config/sh/aws_test/Esign/go-pear.phar/PEAR/go-pear-tarballs/XML_Util-1.4.5.tar...

warning: pear/PEAR dependency package "pear/Archive_Tar" downloaded version 1.4.14 is not the recommended version 1.4.4

install ok: channel://pear.php.net/Archive_Tar-1.4.14

install ok: channel://pear.php.net/Console_Getopt-1.4.3

install ok: channel://pear.php.net/Structures_Graph-1.1.1

install ok: channel://pear.php.net/XML_Util-1.4.5

install ok: channel://pear.php.net/PEAR-1.10.14

PEAR: Optional feature webinstaller available (PEAR's web-based installer)

PEAR: Optional feature gtkinstaller available (PEAR's PHP-GTK-based installer)

PEAR: Optional feature gtk2installer available (PEAR's PHP-GTK2-based installer)

PEAR: To install optional features use "pear install pear/PEAR#featurename"


******************************************************************************

WARNING!  The include_path defined in the currently used php.ini does not

contain the PEAR PHP directory you just specified:

</opt/remi/php83/root/usr/share/pear>

If the specified directory is also not in the include_path used by

your scripts, you will have problems getting any PEAR packages working.



Would you like to alter php.ini </etc/opt/remi/php83/php.ini>? [Y/n] : y


▶ PEAR.php 잘 되는지 확인해 본다. 

pecl channel-update pecl.php.net


현재 디렉토리에 PEAR.php가 없이도 include 하면 오류가 발생하지 않는 것을 알 수 있다.

/usr/local/php82/bin/php -r "include 'PEAR.php';"


위가 가능한 것은 아래를 보면 된다.

/usr/local/php82/bin/php -r "phpinfo();" | grep include



▶ 설치된 PEAR.php 찾아 본다.

find /opt/remi/php83/ -iname PEAR.php

/opt/remi/php83/root/usr/share/pear/PEAR.php



3) PEAR 사용법

그리고 include 하여 사용하면 된다. 이 프로그램을 직접 사용하는 것이 아니라 다른 라이브러리 사용 할 때 이것을 기본으로 사용하기 때문에 필요한 것이다. 






  • 페이스북으로 공유
  • 트위터로  공유
  • 구글플러스로 공유
전체 194건 1 페이지
  • profile_image 앞으로 @ 사용하지 말라고 하니 새로 만드는 프로그램은 try-catch 감싸서 처리 하는 것이 좋다.그래서 필요한 것으로 아래를 참고하면 된다. 그리고 아래 복원하는 함수면 한 줄이기 때문에 함수가 왜? 필요할까 싶지만 이런 경우도 함수로 만들어 사용하면 후에 어려운 일이 발생 했을 때 해결 할 수 있는 좋은 일이 생기게 되기도 한다.  # 사용자 오류처리기   convertErrorsToExceptions();   #   try {    $…
  • profile_image 내장함수에 strip_tags 라는 것이 있습니다.HTML을 삭제하고 txt만 남기죠. 그리고 나서 공백이 2개 이상이거나 줄바꿈이 필요 없거나 탭 같은것은 별도 삭제를 해줘야 합니다. 여기서 다루는 함수는 자바스크립트등 몇가지를 더 삭제해 주는 기능입니다.결과 확인 후 본인에게 맞지 않으면 좀 더 추가 해야 될 수 있는데 요즘은 GPT4 이용하면 도움이 많이 됩니다.  /**   * html2txt    *    * @param mixed $…
  • profile_image 사이트의 페이지를 소켓방식으로 수집할때 많이 사용하는 curl 클래스 입니다.본인의 상황에 따라서 좀더 조건을 줘서 처리를 하면 되며 쿠키를 저장해서 다시 보내줘야 한 다면 이 부분에 대한 주석 처리 된것을 풀어서 테스트 해보면 됩니다.중요한것은 HTTP 프로토콜에 대한 명확한 이해가 가장 중요합니다.원리를 모르는 상태에서 사용을 하다보면 헛발질을 많이 할 수 밖에 없기 때문이죠~코딩을 잘 한다는 것은 깔끔하게 재사용가능하게 하는 것도 중요하지…
  • profile_image AWS SES API를 활용하면서 PEAR 라이브러리 활용할 필요가 있을 때 사용하면 되지만 일반적으로는 사용할 필요는 없습니다.하지만 필요한 분이 있을 수 있어 예전 소스중에 있어 올립니다. 1) PEAR 설치 사용하는 PHP 버전의 경로를 지정해서 설치 해야 한다. wget https://pear.php.net/go-pear.phar /usr/local/php82/bin/php go-pear.phar /usr/local/php82/bin/p…
  • profile_image AWS에서 메일을 발송하는 방법에는 SMTP 설정을 통한 방법이 있고 다른 하나는 API를 이용한 방법이 있는데여기에선 API를 이용한 방법에 대한 예 입니다.보통 간단하게 조금 보낼때는 관계 없는데 많이 보내게 되면 AWS 비용이 비싸고 반송 메일에 따라 좋지 않으면 패널티도 받기 때문에 AWS 이용은 많이 안하는 편입니다.대량메일 발송서비스만 전문으로 해주는곳을 이용하거나 직접 구축하여 발송을 하게 됩니다.한달 몇 천건 정도면 이것 이용해도…
  • profile_image 간혹 PHP만 설치해서 사용하고 최대한 라이브러리 설치 하지 않게 사용하면서 간단하게 암호화할 필요가 있을 경우 사용 합니다. 가능하면 OpenSSL 라이브러리 사용하는 암호화 방식을 추천 합니다.  그리고 어떤 방식이든 대칭형 암호화에서 키는 가능하면 길게 만들고 여기선 md5 사용 했지만 sha512 같은것 사용하면 더 좋고 시간, 또는 일마다 같은 문자도 암호화 결과가 다르게 만드는것이 좋습니다. 그 부분은 개인의 상황에 맞게 별도의 메소…
  • profile_image 다른 언어에선 셀레리움을 많이 사용하는듯 한데 PHP에서 페이스북에서 만든 웹드라이브를 사용합니다.설치는 어렵지 않으며 여기선 윈도우용 PHP가 이미 설치 되어 있다고 가정하고 웹드라이브 설치 하는것 부터 진행 합니다.▷ 윈도우용 컴포저 다운로드https://getcomposer.org/Composer-Setup.exe▷ 필요한 라이브러리 설치composer require php-webdriver/webdrivercomposer require …