Home >Backend Development >PHP Tutorial >Create local PEAR_PHP tutorial
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: If everything goes well, proceed directly to the next step, otherwise run the following command: After this step, pear has been installed. If you want to install other packages, then: 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 PLAIN TEXT 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
$ pear config-create $HOME .pearrc
$ 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
$ pear install pear/PackageName
CODE:
ini_set(
include_path,
ini_get(include_path).PATH_SEPARATOR."/home/(youruser)/pear/php"
);
php5
CODE:
set_include_path(
get_include_path().
PATH_SEPARATOR./home/(youruser)/pear/php
);
Author: volcano Published in June 16, 2007 at 7:46 am