After the basic suite is installed, when developers need to use a suite other than the basic suite, they will need to install the suite. If they do not need a suite, they will want to remove it, if the Suite version is outdated, You need to upgrade the suite, that is, the developer needs a pear suite management system.
There are two ways to install and manage a suite in a Windows operating system: one is to use a web management interface and the other is to use the "Suite command 」. I recommend the latter because the execution speed is fast. However, if you are afraid of instructions, you can use the first method to easily manage the suite.
Web Interface Management Suite
Web suite management is installed by the way when the basic suite is installed in the previous unit. After installing the basic pear kit in the previous unit, the start web rrontend of the pear instoller> link is displayed at the bottom. Click the link to enter the web interface of the suite management, for example:
The location of the webpage file of the management interface is the filename of webfrontend, which is the first configuration item of the previous unit. In my example, set it to C: appserv \ www \ pearindex. PHP, remember to add it to my favorites. In addition, the previous pear. php block can be deleted.
Note that there are three links at the top of the screen. The meanings of these links are: List Installed packages and list all packages) list not installed packages ).
When you enter the kit management web interface, a picture of the installed kit is displayed, which contains the kit name, a summary of the kit function and the kit version number, local indicates the number of the current installation version, and latest indicates the number of the latest version on the pear official website.
If the current version is not the latest version, an upgrade pattern will appear. You can upgrade the kit by case. If you press the recycle bin pattern next to the version number, the kit will be removed, please pay special attention to it.
Next, we will go to the page where no package is installed.
Compared with the screen that shows the installed kit, there is no garbage bin pattern, and the old one is a ghost pattern, this means that users can install the suite as per case.
Installation failed? What can I do when I install it?
Usually the installation failure is mostly due to the dependency of the suite. What is dependency 」? Simply put, some kits need to be installed with other kits before they can be used. Therefore, you must install the dependent kits before installing the kits. You can click the recycle cartridge pattern on the screen, you can view the details of the suite, and other suites that are dependent on the suite will be mentioned. For example:
For example, before installing the cache package, click (! +) Pattern. When viewing detailed information about the suite, the following packages that depend on Cache shows that five packages, including net_dict and image graph, are dependent on the cache suite, therefore, you must install the cache package before you can install these five packages. Otherwise, the installation fails.
The management of the suite is simple and convenient to use the web interface, but the speed is a little slow, and Web users must put the kit folder (this example is C: appserv \ PHP \ pear) write Permission.
I recommend another management method. The reason for recommendation is that it downloads the suite faster and the management function is larger, but the disadvantage is that it requires instructions.
Use commands to manage pear suites
First, as with the previous method, pear must be used first. php web page to install the basic suite, although the Web suite management interface is available after installation, but please do not use it, then go to my computer pattern on the desktop, right click, and a menu appears, select "content". In the system content window, click the environment variable button in the 4th advanced labels, for example:
In the environment variable window, click the path in the system variable pane and press the edit button. The edit system Variable Window appears. Add "; C: appserv \ PHP ". Note that there must be a semicolon ("; ") before" C: ". After editing, press the OK button to close the window, for example:
After completing this step, you can use commands to manage the pear suite.
Let's make a test. Select Start/All Programs (Program sets)/affiliated applications/command prompt characters 」. Enter:
After this command is run, press enter on the keyboard to display all the pear management commands and instructions, as shown in the following figure:
Note: pear commands are available in both upper and lower case in windows.
I will try other commands according to the instructions. For example, to display all installed kits, enter "Pear List". The name, Kit number, and Kit status of the installed kits are displayed.
Invalid Command? Don't worry. If you find that the command is invalid, you only need to find PHP in C: Windows. the INI file is opened in any text editor, and the original "register_argc_argv = off" is changed to "register_argc_argv = On". After archiving, re-open the command prompt text window, that is, you can use the pear command without any difficulty.
You can install it. Note that the kit name can be case sensitive. If the kit status is stable, you do not need to enter the kit number. For example, if you want to install the benchmark suite, you only need to enter
When "Install OK: benchmark 1.2.1" appears in the last line, the installation is successful.
But what should I do if the installation fails due to dependency issues during installation? For example, when I install the html_quickform suite. the message that requires the installation of the html_common suite is displayed, so I have to enter "Pear install html_common ". this command finally displays the word "Install OK.
Then install the html_quickform suite. For example, you can complete the installation.
If you are installing a Beta or alpha version, that is, a trial version suite, enter the complete suite version number after pear install. For example, if you want to install the liveuser suite, but the suite has not been released for stable, you need to use the following command:
That is, the name of the suite must be followed by the version number of the suite. You may ask, how do I know the version number of the suite? Please query the official pear website. If the installed package is not stable and does not have a kit number, an error message "install non-stable" is displayed during installation and the installation is stopped.
This article introduces a good way to be lazy: if you have to install a suite, whether it is stable or beta, you can use a command:
For example, if you want to install the liveuser suite like this, And the hacker is too lazy to check the version number, use this command.
The "-F" in the command indicates "force", which means installation is correct no matter how it is installed.
Remove pear kit with instructions
Removing a suite is much easier than installing it, as long as you enter:
For example, I will remove the benchmark suite, for example:
"Uninstall OK" indicates that the removal of the suite is successful, and the chances of failed removal are very low.
Use commands to upgrade the pear suite
The new version of the kit will be released continuously. to upgrade the old kit to a new one, you only need to enter the command:
For example, if you want to upgrade the package named cache, you only need to enter:
You can. The upgrade process is the same as the installation package. Sometimes the dependency problem may occur and the upgrade fails. You only need to install the dependency package first.
Other commands are rarely used. I will not introduce them here. Please watch them on your own. After you enter the pear command in the command prompt character window, the command description is displayed.
Modify the php. ini file
This is the last job before pear is used. Whether you use the web interface or use commands to manage the suite, you must modify the php. ini file. This file is stored in the C: Windows project. Use a text editor to open it and add the following line:
Remember to archive the file and run Apache again. As you can see, the value of include_path is the path for downloading and installing the pear suite. But why join this line? I will explain it in the next chapter.
Let's check whether the set value has changed when this line is added. Create an archive in C: appserv \ www named phpinfo. php. Write only one row in the archive:
Then input HTTP in the browser; // 127.0.0.1/phpinfo. php or HTTP; // localhost/phpinfo. php
In addition, I suggest changing the value of the allowcall_time_passreference setting item in the PHP. ini file to on. I will explain the cause in Chapter 6th.
If there is no error in all actions and the picture is displayed, you are ready to enjoy the excellent experience brought by pear to multiply the PHP skill.
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