Home > Backend Development > PHP Tutorial > Create local PEAR_PHP tutorial

Create local PEAR_PHP tutorial

WBOY
Release: 2016-07-13 17:36:37
Original
1024 people have browsed it

On some hosts, you may not have permission to modify the system's default pear installation, but you want to install your own pear package. There is also a simple way to achieve this:

First create a pear configuration file .pearrc in your home:
$ pear config-create $HOME .pearrc

If everything goes well, proceed directly to the next step, otherwise run the following command:
$ pear config-set download_dir /home/(username)/tmp/pear/cache
$ pear config-set cache_dir / home/(username)/tmp/pear/cache
$ pear config-set temp_dir /home/(username)/tmp/pear/temp


Then you can start to install pear, which will be installed together with pear’s dependency files:
$ pear install -o PEAR

After this step, pear has been installed. If you want to install other packages, then:
$ pear install pear/PackageName

In this way, you have a customized pear package. In order to call these pear in the program, you need to write some additional code. After all, these codes are not yet in your include_path.

php4

PLAIN TEXT
CODE:
ini_set(
include_path,
ini_get(include_path).PATH_SEPARATOR."/home/(youruser)/pear/php"
);
php5

PLAIN TEXT
CODE:
set_include_path(
get_include_path().
PATH_SEPARATOR./home/(youruser)/pear/php
);
Author: volcano Published in June 16, 2007 at 7:46 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/327

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/486642.htmlTechArticleOn some hosts, you may not have permission to modify the system’s default installation of pear, but you want to install your own pear bag. There is also a simple way to achieve this situation: First, in your own...
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