Copy and install the local Pear on the VM

Source: Internet
Author: User
Tags pear

On Virtual Hosts rented in China, some hosts provide pear class libraries, but you don't have to expect them to upgrade or install the pear packages you need. in this case, you can try to install a pear under your own virtual host.

Install pear through ssh
Most of the domestic virtual hosts do not provide ssh, but if it is a friend's server, it may be a little more relaxed for you. Next 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

In this way, a. pearrc file is created under the user's home.

Add the. bashrc File
PEAR 1.3.2 or below:
$ 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 pear directory is added under the user's home directory, which completely copies the pear on the host.

To use the installed pear package, you must specify include_path in the php code.
PLAIN TEXT
PHP:
<? 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
It is undoubtedly a good idea to install pear on a remote virtual host through ftp. This function is mainly accomplished through the pear package PEAR_RemoteInstaller. There are several points to be determined:

Php 5.0 or above
If you need to use ftps for installation, you need to add openssl extension for php on the local machine.
If you need to install it using ssh, the local php needs to add ssh2 extension.
The pear command line in the php Directory can be executed.
Ftp has write permission
Because of the time relationship, do not write specific steps for the moment. If you need it, you can refer to the following link.

Reference:
Pear manual

Published by volcano on September 10, 2006 at am

Copyright information: this information can be reproduced at will. During reprinting, you must mark the original source and author information of the article in the form of hyperlinks and this statement.

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.