search
Homephp教程php手册创建本地的PEAR

创建本地的PEAR

Jun 13, 2016 am 10:35 AM
pearhostbutRevisecreateexistInstalllocalPermissionsofsystem

在某些主机上,你可能没有修改系统缺省安装pear的权限,但是又希望安装自己的pear包。这种情况下也有简单的办法实现:

首先在自己的home下创建一份pear的配置文件.pearrc:
$ 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


接着就可以开始安装pear了,这会连着pear的依赖文件一块安装:
$ pear install -o PEAR

经过这一步,pear已经安装完成,如果你还希望安装其它的package,那么:
$ pear install pear/PackageName

这样你就有了一份自己定制的pear包,为了在程序中调用到这些pear,你需要多谢写一些额外的代码,毕竟这些代码还不在你的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
);
作者:volcano发表于6月 16, 2007 at 7:46 am

版权信息:可以任意转载, 转载时请务必以超链接形式标明文章原始出处和作者信息及此声明

永久链接 - http://www.ooso.net/index.php/archives/327

Statement
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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
Will R.E.P.O. Have Crossplay?
1 months agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

Atom editor mac version download

Atom editor mac version download

The most popular open source editor