How to install and use pear_php tutorials yourself

Source: Internet
Author: User
Pear, as a standardized and powerful Arsenal in PHP, has been a subject of great concern, but has not been taken seriously in practical areas. The reason, there is incomplete documentation, learning information is not sufficient, the code system is more complex, there is insufficient support of developers.
But sooner or later this arsenal will be given enough attention. If you can start learning now, you may be able to take advantage of the opportunity.
Pear There is a support issue in use. Many servers may use disable pear at compile time, so pear is not supported. Because the installation needs to have permission to modify php.ini, the user may feel powerless on an unsupported host.
Another situation is that the host server provides pear, and you can see the pear included in Phpinfo, but because the host is running in Safe mode, you cannot use it because the owner of the pear is not you.
One way to do this is to install pear on your shared host.
As per the requirements of the pear documentation, your PHP can be used in more than 4.04 versions, but some modules require more than 4.05, which actually means the minimum or the 4.05 version. Of course this is not a problem, because if your host is still in 4.06 you should consider changing the host.
Pear itself version of the choice poetry needs to be considered. You may notice that all of the PHP published source packages contain pear, but in fact the pear in the latest pre version is not complete at all. So my advice is to download the 4.23 release package, unzip the contents of the Pear directory to your home directory, the directory name remains pear.
If you are patient enough, you can download the latest version of 4.30pre2 and then use the Diff tool for comparison (I mean Windows users.) ), you can replace the old file with the newly changed file directly.
If you take the trouble, you can go to the Pear directory in http://cvs.php.net to download the latest version of each file.
Using pear:
In the head of your program to join
Ini_set ("Include_path", "/absolute/path/to/pear");
This way you will change the include_path directly to your pear directory.
One drawback of the above setup is that if you have any other included directories, you will be canceled. So you need to consider other existing include paths.
It is suggested in the user comments in the PHP manual that:
Ini_set ("Include_path", Ini_get ("Include_path"). ":/path/to/pear");
Such a way.
I am not sure that this may be possible for you.
But at least my server doesn't support it, so there's a problem.
For me to use only:
$oldpath = Ini_get ("include_path");
Ini_set ("Include_path", "/path/to/pear:". $oldpath);
Take a closer look at the difference between the two, that is, the pear path is the beginning or the final question. (where the colon is the delimited symbol of the path).
I think you may need to test both cases to see if that can be used.


http://www.bkjia.com/PHPjc/629466.html www.bkjia.com true http://www.bkjia.com/PHPjc/629466.html techarticle pear, as a standardized and powerful Arsenal in PHP, has been a subject of great concern, but has not been taken seriously in practical areas. The reason, there is incomplete documentation, learning information is not sufficient ...

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

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.