Cara install PHP PEAR di Debian 9

Tutorial install PHP PEAR di Linux Debian 9 Stretch server, bisa untuk VestaCP juga. Akses terminal Linux atau  SSH PuTTY login dengan akun root. Ikuti langkah berikut:

Membuat folder

Membuat folder untuk proses sementara instalasi PEAR

mkdir -p /home/idnetter/pear/tmp/pear/install; cd

Ganti user idnetter dengan user aktual server Anda

Download PEAR

apt install wget -y; wget http://pear.php.net/go-pear.phar

Install PEAR

php go-pear.phar

Tampilannya seperti ini

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) : /usr
2. Temporary directory for processing : /tmp/pear/install
3. Temporary directory for downloads : /tmp/pear/install
4. Binaries directory : /usr/bin
5. PHP code directory ($php_dir) : /usr/share/php
6. Documentation directory : /usr/docs
7. Data directory : /usr/data
8. User-modifiable configuration files directory : /usr/cfg
9. Public Web Files directory : /usr/www
10. System manual pages directory : /usr/man
11. Tests directory : /usr/tests
12. Name of configuration file : /etc/pear.conf

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

Pilih/ketik angka 2 lalu Enter

Muncul lagi seperti ini, isi sesuai path direktori yang dibuat di langkah awal tadi, kemudian tekan Enter

(Use $prefix as a shortcut for '/usr', etc.)
Temporary directory for processing [/tmp/pear/install] : /home/idnetter/pear/tmp/pear/install

Selanjutnya, muncul lagi seperti ini

1. Installation base ($prefix) : /usr
2. Temporary directory for processing : /home/idnetter/pear/tmp/pear/install
3. Temporary directory for downloads : /tmp/pear/install
4. Binaries directory : /usr/bin
5. PHP code directory ($php_dir) : /usr/share/php
6. Documentation directory : /usr/docs
7. Data directory : /usr/data
8. User-modifiable configuration files directory : /usr/cfg
9. Public Web Files directory : /usr/www
10. System manual pages directory : /usr/man
11. Tests directory : /usr/tests
12. Name of configuration file : /etc/pear.conf

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

Dan tekan Enter

Berikutnya, paste full path direktori yang kita buat tadi

(Use $prefix as a shortcut for '/usr', etc.)
Temporary directory for processing [/tmp/pear/install] : /home/idnetter/pear/tmp/pear/install

Tekan Enter

Tekan Enter lagi

Biarkan, sampai proses berakhir dengan keterangan seperti ini

Beginning install...
Configuration written to /etc/pear.conf...
Initialized registry...
Preparing to install...
installing phar:///home/noc/go-pear.phar/PEAR/go-pear-tarballs/Archive_Tar-1.4.7.tar...
installing phar:///home/noc/go-pear.phar/PEAR/go-pear-tarballs/Console_Getopt-1.4.2.tar...
installing phar:///home/noc/go-pear.phar/PEAR/go-pear-tarballs/PEAR-1.10.9.tar...
installing phar:///home/noc/go-pear.phar/PEAR/go-pear-tarballs/Structures_Graph-1.1.1.tar...
installing phar:///home/noc/go-pear.phar/PEAR/go-pear-tarballs/XML_Util-1.4.3.tar...
install ok: channel://pear.php.net/Archive_Tar-1.4.7
install ok: channel://pear.php.net/Console_Getopt-1.4.2
install ok: channel://pear.php.net/Structures_Graph-1.1.1
install ok: channel://pear.php.net/XML_Util-1.4.3
install ok: channel://pear.php.net/PEAR-1.10.9
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"

The 'pear' command is now at your service at /usr/bin/pear

** The 'pear' command is not currently in your PATH, so you need to
** use '/usr/bin/pear' until you have added
** '/usr/bin' to your PATH environment variable.

Run it without parameters to see the available actions, try 'pear list'
to see what packages are installed, or 'pear help' for help.

For more information about PEAR, see:

http://pear.php.net/faq.php
http://pear.php.net/manual/

Thanks for using go-pear!

Restart web server

Untuk Apache

systemctl restart apache2

Perintah restart untuk Nginx+PHP-FPM (sesuaikan versi PHP ya)

systemctl restart php7.0-fpm

Selesai, semoga bermanfaat kawan.

Add a comment