PEAR.php 설치방법 및 사용법
파일은 없는데 아래와 같은 형태로 읽혀 들이는 것이 있다면 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 하여 사용하면 된다. 이 프로그램을 직접 사용하는 것이 아니라 다른 라이브러리 사용 할 때 이것을 기본으로 사용하기 때문에 필요한 것이다.