How to install and use PEAR on your own

Source: Internet
Author: User
Tags pear safe mode
PEAR, as the library of PHP standardization and powerful functions, has been of great interest for a long time, but has not been paid much attention to in practical fields. The reason is that there are incomplete documents, insufficient learning materials, complicated code systems, and insufficient developer support.
However, this Arsenal will be given sufficient attention sooner or later. If you can start learning now, you may be able to take the lead.
There is a support problem in PEAR usage. Many servers may use disable pear during compilation, so that PEAR is not supported. Because the installation requires the permission to modify php. ini, users may feel powerless for unsupported hosts.
In another case, the host server provides PEAR, and you can also see PEAR in phpinfo. However, because the host runs in safe mode ), in this way, because the PEAR owner is not you, you still cannot use it.
You can install PEAR on your shared host.
According to the PEAR documentation, your PHP version 4.04 or later can be used, but some modules require more than 4.05, which means that the minimum requirement is 4.05. Of course this is not a problem, because if your host is still 4.06, you should consider changing the host.
The question to consider when choosing the poetry of PEAR. You may notice that all source program packages released by PHP contain PEAR, but in fact the PEAR of the latest PRE version is not complete at all. Therefore, we recommend that you download the 4.23 release package, decompress the package, and upload all the content of the pear directory to your main directory. The directory name remains pear.
If you are patient enough, you can download the latest version 4.30pre2 and use the diff tool for comparison (I am a windows user .), Replace the new file with the old one.
If you're bored, you can go to the pear directory in the to download the latest versions of each file.
Add in your program header
Ini_set ("include_path", "/absolute/path/to/pear ");
In this way, you can change include_path to your pear directory.
One disadvantage of the preceding settings is that if you have another directory, it will be canceled. Therefore, you need to consider other existing include paths.
In the user notes in the php manual, it is recommended that:
Ini_set ("include_path", ini_get ("include_path"). ":/path/to/pear ");
In this way.
I'm not sure. This may work for you.
However, at least my server does not support this problem.
For me, you can only use:
$ Oldpath = ini_get ("include_path ");
Ini_set ("include_path", "/path/to/pear:". $ oldpath );
Let's take a closer look at the gap between the two, that is, whether the pear path is placed at the beginning or the end. (The colon is the separator of the path ).
I think you can test two cases to see which one can be used.

Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

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: and provide relevant evidence. A staff member will contact you within 5 working days.