Developer on Alibaba Coud: Build your first app with APIs, SDKs, and tutorials on the Alibaba Cloud. Read more ＞
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 http://cvs.php.net 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.
This article is an English version of an article which is originally in the Chinese language on aliyun.com and is provided for information purposes only. This website makes no representation or warranty of any kind, either expressed or implied, as to the accuracy, completeness ownership or
reliability of the article or any translations thereof. If you have any concerns or complaints relating to the article, please send an email, providing a detailed description of the concern or
complaint, to email@example.com. A staff member will contact you within 5 working days. Once verified, infringing content will be removed immediately.
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.