Home > Backend Development > PHP Tutorial > Copy and install native Pear_PHP tutorial on virtual host

Copy and install native Pear_PHP tutorial on virtual host

WBOY
Release: 2016-07-13 17:36:45
Original
876 people have browsed it

On domestic rented virtual hosts, some hosts themselves provide pear libraries, but don’t expect them to upgrade or install the required pear packages for you. In this case, you can try Install a copy of pear.

on your own virtual host

Install pear through ssh
Most domestic virtual hosts do not provide ssh, but if it is a friend's server, they may be more relaxed and give you permissions. Let's take a look at the steps to install pear on the virtual host through ssh:

PEAR 1.3.5 or below:
$ pear -s -c ~/.pearrc -d doc_dir=~/pear/docs
-d ext_dir=~/pear/ext -d php_dir=~/ pear/lib
-d data_dir=~/pear/data -d test_dir=~/pear/tests
-d cache_dir=~/pear/cache -d bin_dir=~/pear/bin

PEAR 1.4 or above:
$ pear config-create /home/user/pear .pearrc

This creates a .pearrc file under the user's home

Add
PEAR 1.3.2 or below to the .bashrc file:
$ pear -c ~/.pearrc install Archive_Tar PEAR Console_Getopt XML_RPC
PEAR 1.3.3 or above
$ pear install - o PEAR

In this way, a new pear directory is added to the user's home directory. This pear is a complete copy of the pear on the host.

In order to use the pear package you just installed, you need to specify include_path in the php code
PLAIN TEXT
PHP:
ini_set(include_path,~/pear/lib . PATH_SEPARATOR
.ini_get(include_path));

// From PHP 4.3.0 onward, you can use the following,
// which especially useful on shared hosts:
set_include_path( ~/pear/lib. PATH_SEPARATOR
.get_include_path());
?>
Install pear through ftp/ftps/sftp
Install pear on the remote virtual host through ftp or the like, this It is undoubtedly a good idea. This function is mainly accomplished through pear's package PEAR_RemoteInstaller. There are a few points to be sure:

This machine is PHP 5.0 or above
If you need to use ftps to install, then the local PHP needs to add openssl extension
If you need to use SSH to install, then the local PHP needs to add the ssh2 extension
php directory The pear command line is executable
ftp has write permissions
Due to time constraints, I will not write down the specific steps for the time being. Friends in need can refer to the link below.

Reference document:
pear manual

Author: volcano Published on September 15, 2006 at 8:40 am

Copyright information: You can reprint at will. When reprinting, please be sure to indicate the original source and author information of the article and this statement in the form of a hyperlink

Permanent link - http://www.ooso.net/index.php/archives/241

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/486638.htmlTechArticleOn domestic rented virtual hosts, some hosts themselves provide the pear class library, but there is no need to count on them. You will be given the pear package you need to upgrade or install. In this case, you can try to install it yourself...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template