php What is pear? Second article

Source: Internet
Author: User
Tags pear
▓ Kit Introduction
The most important thing about pear is that there are a lot of libraries available for developers to refer to for free, and the libraries will be packaged, and each suite will be placed in a file called Package.xml. This is the Pear team's rules, this file records the library file structure, version number and other information, with this file, the library is compressed to qualify as a "suite", and because of this XML file, Pear provides " Suite Management Instructions "you can easily manage libraries, such as: you can use instructions to install packages, delete packages, watch package information, or upgrade packages."
Another With regard to the security of the kit, users who find a problem with the kit can be discussed by the forum or rewarded to the development team, they will be quickly revised and revised, so each suite will have a version number to distinguish the process of revision.
For more information, please visit the official website of the attached a.pear.
Note that if you follow the example of this article, if you find that the results are not the same as what we introduced, please do not feel strange, that is because the Pear Suite update is too fast, we will introduce the method and the original intent is not changed, but the process will change with the package changes.
▓ how to learn about the kit
To download the kit or learn about the kit, readers can access the Pear official website (http://pear.php.net)
Circle's hyperlink is where the placement kit is located.
The more thick black word in circle 1th represents the class of the package, for example: The 1th class is called the Authentication Class (authentication). This category currently contains 8 packages, which are used to handle login and logout or identity authentication and permission settings.
The smaller word in circle 2nd represents the name of the package, such as: Auth, Auth http, and so on. You can click on each kit name to view more detailed kit information or download the kit.
So far, there are 35 categories, more than 300 kits, and a total of 202 people in the development kit, but these numbers are growing, and if you want to contribute to a member of the Pear Community One day, you can also apply to be a developer of the kit. Pear
To use the Pear library, there are several basic steps:
1. Set up a good Web server, such as Apache, and install PHP and Mysol.
2. Some basic packages of pear must be installed, so-called "basic Kit" is the kit required for all pear kits, for example, in addition to the wrong is required for each kit, so the basic suite contains the debugging kit, only the first installation of the wrong package, the other package can be successfully debug.
3. Install specific packages for the needs of the developer. For example, after installing the base suite. If a developer wants to include the ability to calculate execution time in a Web page, they must install the benchmark suite with instructions, which is not a basic suite and must be installed by the developer itself.
4. Reference the suite's library file in a PHP program.
Below we will describe how to install and manage the Pear suite under the Windows operating system and UNIX-like operating systems.
3-2 installation and management of pear on Windows-series operating systems
▓ installation Apache+php+mysql
If you have not built a PHP execution environment, it is recommended that you install Appserv six-in-one software, the author is using Appserv as a Windows Server environment. This software can be downloaded to the official website of http://www.appservnetwork.com/.
Installation method of ▓pear
Once Appserv is installed, you can start installing Pear's basic kit on Windows, which can be divided into four steps.
1th step: Go to http;//go-pear.org/website
Please connect with http;//go-pear.org/'s website first
Then, after the text in the Web page is completely copied, open the system's affiliate application of Notepad, the text pasted just copied, paste the file stored in c:appserv\www, that is, the site root directory location, please note that the archive type please select all files, the secondary name needs to be PHP, Please name the file name, assuming I customize the archive named pear.php, such as:
If you don't want to get into trouble, you can also use a Web page editing software like Dreamweaver, open a blank php file, and then paste and archive the text that http://go-pear.org copied.
2nd Step: Install the basic kit
Open the browser and enter "http;//127.0.0.1 copy go-pear website file" in the URL field. php "or" http;//localhost/copy go-pear Web file. php ", which is called" Copy go-pear Web file. "php" Just copy the copy of the file name of the copied text, in this example is pear.php, so I enter "http;//127.0.0.1/pear.php", can appear on the line to install Pear Web page
The first screen is welcome screen, I do not introduce more. Please press Next >&gt, and proceed to the next step of installation.
This page is used to set the installation location of the Pear kit, the top has an HTTP proxy field, if the installer through proxy to connect to the Internet, please enter the IP and port of the proxy in this, if there is no use proxy, this field can be kept blank. Then there is the setting of the L0 installation path, which knows the special note, where 3 paths must be modified, divided into:
1. For the install prefix of item L, please change the preset c:appserv﹨www to c:appserv﹨php
For the Pear library that I want to be installed, do not put it in a Web page that is mixed up with the root catalogue.
2. The filename of Webfrontend for item 9th, change the preset value to c:appserv﹨www﹨pear﹨index.php. This means that a folder named Pear is produced in www, and the index.php in the folder is the system-generated suite management interface, which is mentioned later (to prevent subsequent operations from failing, first create a folder named Pear in c:appserv﹨www).
3. The 10th item Php.exe path needs to be changed to C:appserv﹨php﹨php.exe, that is, you need to specify the correct Php.exe file location.
The rest of the settings are used as presets, so here's a quick introduction to the other settings:
The 2nd item of binaries Direetory is to designate the first item of c:appserv﹨php as the root of the pear and to represent it with variable $prefix.
The 3rd Item of PHP code Directory is where the Pear suite is placed after the file is installed. This example Pear kit will be downloaded after the file is installed in the c:appserv﹨php﹨pear.
The 4th item is that if the installed kit has an enclosed documentation, this example will be placed in C:appserv﹨php﹨pear﹨docs.
5th item if the installed kit has an attached sample file, this example will be 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 the location of the PEAR cache file, and this example will be placed in C:appserv﹨php﹨pear﹨cache.
The 8th item is the cache file's longevity, this example is the life of the fast file is 300 seconds, that is, 300 seconds will be re-cache.
In addition, it is important to note that the reader of the Web page must have write permission to these paths, otherwise it cannot be installed.
After the settings have been modified, you can install them by pressing the minimum side install button.
When the top-most installation progress reaches 100%, congratulations, you have completed the installation of the basic kit. According to my use of the ADSL download speed of 2M test, about 2 minutes to install, if everyone's network speed is not fast, or in half of the installation 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 don't be happy, pear a total of more than 300 packages, so far just installed the basic kit of pear, and did not install all the kits, other than the basic kit will wait until the developer needs to use the installation.
You might ask, "How are the other packages installed?" Will it be a hassle? " Please rest assured that this is not a hassle, the next small unit will be in the installation and management of the package is described in detail.
After installing the basic kit, you will find a folder called Pear in c:appserv﹨php, which is the path where the library is placed after the package has been downloaded and decompressed.
For everyone, there are good things to learn pear in the two folders, docs and tests. Some kits will be accompanied by the use of teaching documents, and if the user installs the kit, the teaching documents will be placed in the Docs folder. In some cases, the sample program appears in the tests folder after the user installs the package.
Management of the ▓pear suite
After installing the basic kit, when the developer needs to use a kit other than the base kit, they will need to install the kit, and if a kit is not needed, they will want to remove the kit, if the package version is too old, you need to upgrade the kit, that is to say, developers need a pear suite management system.
There are two ways to install and manage suites under the Windows operating system, one is to use the Web management interface, and the other is to use the "suite Instructions". The author recommends the latter, because the execution is faster, but if you are afraid of the command, you can also use the first to easily manage the suite.

The above is the introduction of PHP what is pear? The second article, including the aspects of the content, I hope that the PHP tutorial interested in a friend helpful.

  • Related Article

    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.