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. Install pear through ssh PEAR 1.3.5 or below: PEAR 1.4 or above: This creates a .pearrc file under the user's home Add 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 This machine is PHP 5.0 or above Reference document: 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
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 -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 config-create /home/user/pear .pearrc
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
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:
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.
pear manual