php What is pear? (second article) _php Foundation

Source: Internet
Author: User
Tags auth install php pear
▓ Kit Introduction
The most important thing about pear is that there are a lot of libraries that can be referenced by developers for free, and these libraries will be wrapped in packages, and a file named Package.xml will be placed in each suite. This is the Pear team's rules, this file records the library's file structure, version number, and so on, with this file, the library is compressed to qualify as a "suite", and because of this XML file, pear provides the " Suite Management directives make it easy to manage libraries, such as using directives to install kits, delete kits, view suite information, or package upgrades.
Another On the security side of the suite, if users find that the suite has problems, can be discussed by the forum or return to the development team, they will be quickly revised and revised, so each package will have version number to distinguish between the revision process.
For more information, please read the official website of A.pear.
Note that if you follow the example in this article, if you find that the results are different from what we introduced, don't be surprised, because the Pear Suite update is too fast, the method and intent we introduced will not change, but the process will change with the package.
▓ how to learn about the kit
To download the kit or understand the kit, readers can access the Pear official website (URL for http://pear.php.net)
The circle hyperlink is where the package is placed
Number 1th is the class of the soiled word representative suite, for example: The 1th class is called the Authentication Class (authentication). This class does not currently contain 8 kits, which are used to process login and logout or identity authentication and permission settings.
Number 2nd, the smaller word represents the name of the suite, such as Auth, Auth http, and so on. You can click on the name of each suite to see more detailed kit information or download kits.
So far, Pear's suite has 35 categories, more than 300 kits, a total of 202 development kits, but these numbers are on the increase, if you will one day, also want to contribute to a member of the Pear community, can also apply to become a suite of developers.
There are several basic steps you can take to use the Pear library:
1. Set up Web servers, such as Apache, and install PHP and Mysol.
2. Some of the base kits for pear must be installed, the so-called "basic suite" is the suite that all pear suites need, for example, except the error is required for each suite, so the basic suite contains a debug suite, only the first installation of the wrong suite, the other suites can be successfully debugging.
3. Install specific kits for developers ' needs. For example, after installing the base kit. If a developer wants to add the ability to calculate execution time on a Web page, he or she must install the benchmark kit with instructions, which is not a basic suite and must be installed by the developer.
4. Reference a program library file in a PHP program that references a suite.
Here's how to install and manage the Pear suite under Windows operating systems and UNIX-like operating systems.
3-2 installation and management of pear on Windows series operating system
▓ installation Apache+php+mysql
If you have not yet built a good PHP execution environment, we recommend that you install Appserv six All-in-one software, the author is using Appserv as Windows Server environment. This software can be downloaded to the official website of http://www.appservnetwork.com/.
Installation method of ▓pear
Once the Appserv is installed, you can start installing Pear's basic kit on Windows, which can be divided into four steps.
1th Step: Enter the http;//go-pear.org/website
Please connect to http;//go-pear.org/'s website first
Then, when the text in the page is completely copied, open the system's affiliate Program Notepad, will just copy the good text affixed, affixed to the file stored in c:appserv\www, that is, the site root directory location, keep in mind, archive type, please select All files, vice-blocking name needs for PHP, Please name the filename, assuming that I have a custom archive named pear.php, as shown below:
If you don't want to bother, you can also use web editing software like Dreamweaver, open a blank php file, and then paste and archive http://go-pear.org copied text.
Step 2nd: Install the base kit
Open the browser, enter the "http;//127.0.0.1 copy go-pear Web site file. php" or "http;//localhost/copy go-pear website file. php" In the URL field, where the so-called "copy go-pear site file. php" Just copy the name of the file that stores the copied text, for pear.php in this example, so I enter "http;//127.0.0.1/pear.php" to have the Web page where pear is installed on the line
The first screen is welcome screen, I do not do more introduction. Press Next >&gt, and proceed to the next installation step
This page is used to set the Pear Suite installation location, the top has an HTTP proxy field, if the installer needs to use proxy to connect to the Internet, please fill in the proxy IP and port, if no proxy, this field can remain blank. Then there are l0 installation path settings, familiar with special attention, there are 3 of paths must be modified, the difference is:
1. For the install prefix of item L, please change the preset c:appserv﹨www to c:appserv﹨php
For the Pear library I want to install, do not mix it with the Web pages in www.
2. The filename of the 9th of Webfrontend, change the default value to c:appserv﹨www﹨pear﹨index.php. This means that a folder named Pear is produced in the WWW and the index.php in the folder is a system-generated suite management interface, which is mentioned later (to prevent subsequent operations from failing, create a folder named Pear in the c:appserv﹨www).
3. The 10th Php.exe path needs to be changed to C:appserv﹨php﹨php.exe, which is the location where the correct Php.exe file needs to be specified.
The rest of the settings are set with a preset, and here's a quick introduction to the meaning of other settings:
The 2nd binaries Direetory is to designate the c:appserv﹨php of the first item as the root of pear and represent it with variable $prefix.
The 3rd PHP code Directory is where the pear suite is placed when the file is installed. This sample Pear suite is downloaded and the file will be installed in C:appserv﹨php﹨pear.
The 4th item is that if the installed kit has an attached stated document, this example is placed in the C:appserv﹨php﹨pear﹨docs.
5th sufficient if the installed kit has an attached sample file, this example is placed in the c:appserv﹨php﹨pear﹨data.
The 6th item is if the installed kit has an attached test file. This example will be placed in the c:appserv﹨php﹨pear﹨test.
The 7th item is where PEAR's cache file is placed, and this example is placed in C:appserv﹨php﹨pear﹨cache.
The 8th item is the longevity of the cache file, the example of the longevity life is 300 seconds, that is, 300 seconds later will be quickly fetched.
In addition, it is important to note that Web page readers must have write permission to these paths, otherwise they cannot be installed.
After the settings have been modified, press the Install button of the smallest party to install
When the top installation progress reaches 100%, congratulations, you have completed the installation of the basic suite. According to my ADSL download speed of 2M environment test, about 2 minutes is installed, if everyone's network line speed is not fast, or installed to half of the line interruption, please press the top of the browser to rearrange the button or press F5 can be reinstalled.
After the installation is complete. Please do not be happy, pear has more than 300 kits, so far only installed the basic Pear kit only, and do not have all the kits installed, other than the basic suite and other packages will be installed when the developer needs to use.
You may ask, "How are the other kits installed?" Would it be too much trouble? " Please rest assured that this is not troublesome, the next small unit will be for the package installation and management to do a detailed introduction.
After you install the base kit, you will find a folder named Pear in c:appserv﹨php, which is the path where the library is placed after it is downloaded and uncompressed
For everyone, the docs and tests of the two folders will have good things to learn about pear. Some kits will be attached with instructional files, and if the user installs the kit, the teaching files will be placed in the Docs folder. And some of the packages are sample programs, and after the user installs the kit, the sample program appears in the Tests folder
Management of ▓pear Kits
When the base kit is installed, the developer needs to install the kit when they need to use a suite other than the base suite, and if the suite is not needed, the package will be removed, and if the kit version is older, the package needs to be upgraded, which means that the developer needs a Pear suite management system.
There are two ways to install and manage a suite of packages under Windows operating system, one is to use the web's management interface and the other to use the suite instructions. I recommend the latter, because the speed of execution faster, but if you are afraid of the instructions, you can use the first to easily manage the suite.

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.