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. In this case, there is a simple way to achieve it:
first create a pear configuration file.pearrc under your home:
$ pear config-create $HOME .pearrc
If everything goes well, go 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 still want to install other packages, then:
$ pear install pear/PackageName
so that 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 in your include_path yet.
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 on 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
the permanent link of this statement in the form of a hyperlink - http://www.ooso .net/index.php/archives/327