php What is pear? (third article) _php Foundation

Source: Internet
Author: User
Tags benchmark pear phpinfo
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.
Using Web interface Management Suite
Web Suite Management When the basic suite is installed in the previous unit. It has been installed by the way. After installing the Pear Base Suite screen in the previous unit, the link to the start web rrontend of the Pear instoller>> appears at the bottom of the list, and you can then enter the Web interface for the suite management, as shown in the following figure:
Managing the location of the interface page file, which is the 9th of the previous unit, filename of webfrontend, I use the example set to c:appserv\www\pearindex.php, and remember to add it to my favorites. In addition, the previous pear.php block can be removed.
Notice that there are 3 links above the picture above, and the meaning is to show the installed kit (list installed packages), show all the packages (list all packages), display the packages that have not been installed (list not installed Packages).
When you enter the Suite Management Web interface, there is a screen showing the installed kit, a package name, a summary of the suite's functionality, a Syria of the suite, and the number of the current installation version, the latest on behalf of the latest version of the Pear official online.
If the current installation is not the latest version, there will be a upgrade pattern, press the pattern can be upgraded kit, version number next to the recovery tube pattern if pressed, will be removed, please special attention.
Then we go into the show not yet installed package screen
With the display of the installed set of the picture of Datong small, compared to the same as the same is not a garbage bin pattern, take the old generation is a ╂ pattern, meaning that users just press the pattern can install the kit.
Installation failed? What happens sometimes when a user installs?
Usually the installation failure problem is mostly out of the "dependencies" of the suite, what is "dependencies"? Simply put, some of the packages need to be installed before they can be used, so you have to install the dependent kits before you install the kit, you can click the recycle cartridge pattern in the screen to view the details of the kit, which mentions other packages that are dependent on the suite. The following figure:
For example: Above, the author installs the cache kit before, click (!+) pattern, watch the details of the package, in the bottom of the packages that depend on cache found net_dict, Image graph and other 5 suites and cache suite dependencies, The cache kit must be installed before the 5 kits can be installed. Otherwise, installing these packages directly will cause the "Installation Failed" message window to appear.
Suite Management Leveraging the Web interface is simple and convenient, but at a slower pace, and web users must have write permissions to the folder where the suite is placed (this example is C:appserv\php\pear).
I recommend another management method, the reason is recommended because it is faster to download the package, more powerful management, but the disadvantage is that the need to call instructions.
Manage Pear Kits with instructions
First of all, with the previous method need to use the PEAR.php Web page to install the basic suite, although the installation of the existing Web suite management interface available, but please user sat, then to the desktop of my Computer graphics, press the right button, appear menu, please select " Content ", you will jump out of the System Content window, select the environment variable button in the 4th Labeled Advanced tab, as shown in the following figure:
Appear Jing boundary Variables window, please click the System variables pane in the path, press the Edit button, there will be editing system Variables window, in the Variable Value field at the end of the add "; C:appserv\php ", please note that" C: "Must have a semicolon ("; ") Oh, finish editing press OK button to close the window, the following figure:
As soon as you complete this step, you can use instructions to manage the Pear suite.
Let's do a test. Please select Start/all program (assembly)/Affiliate application/Command prompt character. After > enter:
This command and then press the ENTER key on the keyboard, will appear all pear management instructions and explain, the following screen:
Note: The PEAR directive uses both uppercase and lowercase in the Windows system
I then tested the other instructions according to the above illustration. For example, to display all installed kits, just enter "pear list" and the screen will appear with the name of the currently installed suite, the suite number, the suite status
Instructions fail? Don't worry, if the instructions fail to find, as long as the c:windows find php.ini file and any one of the text editor to open it, the original "Register_argc_argv=off" to "Register_argc_argv=on", archived, When the command prompt is closed and reopened, the Pear directive can be used without hindrance.
Can be installed, please note that the package name can be used in case, if the package status is stable version, do not enter the package number, for example: the author to install benchmark kits, as long as the input
When the last line appears "Install Ok:benchmark 1.2.1", the installation succeeds.
But what happens when a dependency problem is installed and the installation fails? For example, when I install the Html_quickform kit. There was a message to install the Html_common kit first, so I had to type "pear Install Html_common" again. This instruction, finally appears "install OK" the word.
Then install the Html_quickform Kit, as shown below.
If you are installing a beta or alpha version that is also a trial version, enter the full suite version number after the pear install. For example, if you want to install the Liveuser Kit, but the kit does not currently release the stable version, then you need to use the following instructions:
That is, the package name must be followed by the version number of the suite, and people will ask, how do I know the version number of the suite? Please check the official website of Pear. If the installed kit is not a stable version and does not fill in the kit number, the error message "Install a stable version" appears and the installation is stopped.
A good way to get lazy: if you have to install a kit, whether it's a stable version or a beta, you can use one of these instructions:
For example, if you want to install the Liveuser kit, but don't bother to look up the version number, use this instruction.
The "-F" in the directive represents the compelling meaning of "force", which is to install it anyway.
Remove Pear kits with instructions
The removal kit is much simpler than the installation, as long as you enter:
This instruction can be as follows: Suppose I will remove the benchmark kit, as shown in the following figure:
The last occurrence of "uninstall OK" on behalf of the removal kit succeeded, the removal of the package is very low probability of failure, please rest assured.
Upgrade Pear Kits with instructions
A new version of the suite is constantly released, and it's very simple to upgrade the Vieta to a new suite, just enter the instructions:
Can be, for example: the author to upgrade a suite named Cache, as long as the input:
It's OK. The upgrade process is the same as the installation kit, and sometimes a dependency problem occurs and the upgrade fails, as long as you install the dependency suite first.
Other instructions are less used, I will not introduce here, please see for yourselves. As long as you enter the pear instruction in the command prompt character window, the instructions appear.
Modify php.ini File
This is the last work of pear before use, no matter you use the Web interface, but also enough to use instructions to manage the suite, you need to modify the php.ini file. This file is placed in the c:windows, please use the text editor to open it to add a line of words as follows:
After joining, remember to archive and execute Apache again, that's it. As you can see, the value of include_path is to download and install the path to the Pear suite, but why do you want to join the trip? The next chapter will explain.
Let's look at whether adding this line will change the set value. Please create a file in c:appserv\www named phpinfo.php, which writes only one line in the file:
Then enter http;//127.0.0.1/phpinfo.php or http;//localhost/phpinfo.php in the browser
In addition, I recommend that you change the value of the Allowcall_time_passreference setting in the php.ini file to ON, because I will explain it in chapter 6th.
If all the action is not wrong, the picture appears as above, then, you are ready to enjoy the multiplication of the PHP skills pear experience it.

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.