After installing the basic suite, when the developer needs to use other suites other than the basic suite, he will need to install the suite. If a certain suite is not needed, he will want to remove the suite. If the suite version is too old, he needs to upgrade the suite, which means that the developer needs a management system for PEAR suites.
There are two ways to install and manage a suite under the Windows operating system. One is to use the web management interface, and the other is to use the "kit instructions". The author recommends the latter because it executes faster, but if you are afraid of instructions, you can also use the first one to easily manage the suite.
Use web interface management suite
Web Suite Management When installing the basic suite in the previous unit. It's already installed by the way. After installing the PEAR basic suite in the previous unit, the Start Web Rrontend of the PEAR instoller>> link will appear at the bottom. Click to enter the web interface of the suite management, as shown below:
The location of the management interface webpage file is the 9th setting item of the previous unit Filename of WebFrontend. The example I use is to set it to c:AppServ\www\, remember to add it to my favorite. In addition, previous blocks can be deleted.
Please note that there are 3 links above the picture above, which represent the meanings of list installed packages, list all packages, and list not installed packages.
When entering the suite management web interface, the screen appears with the installed suite name, the summary description of the suite functions and the version number of the suite. Local represents the number of the currently installed version, and Latest represents the number of the latest version on the PEAR official website.
If the current version is not installed, an upgrade pattern will appear. Press the pattern to upgrade the kit. If the recycle barrel pattern next to the version number is pressed, the kit will be removed. Please pay special attention.
Then we enter the screen that shows the kit not installed yet
The same is true for the screen that displays the installed kit. Compared with the same thing, there is no trash can pattern. It was replaced by an old pattern, which means that the user can install the kit by just pressing the pattern.
Installation failed? What should users do when installing?
Usually, the problem of installation failure lies in the "dependence" of the kit. What is "dependence"? Simply put, some kits need to be installed with other kits before they can be used, so you must first install the dependent kit before installing this kit. You can click the recycling barrel pattern in the screen to view the detailed information of the kit, which will mention other kits that are dependent on the kit. As shown in the figure below:
For example: In the above picture, before installing the Cache kit, I click the (!+) pattern to view the detailed information of the kit, and found in the bottom Packages that depend on the Cache kit, five suites such as Net_Dict and Image Graph are dependent on the Cache kit, so you must first install the cache kit before you can install these 5 suites. Otherwise, installing these kits directly will cause a message window of "installation failed".
The management of suites is really simple and convenient to use the web interface, but the speed is a bit slow, and web users must have write permissions to the folder where the suite is placed (this example is c:AppServ\php\PEAR).
The author recommends another management method. The reason for the recommendation is that it downloads the suite faster and has stronger management functions, but the disadvantage is that it requires commands.
Manage PEAR suite with instructions
First of all, like the previous method, you need to use a web page to install the basic suite. Although the web suite management interface is available after installation, the user is asked to prepare instead of using it. Then go to the My Computer pattern on the desktop, press the right click, and the menu appears. Please select "Content" and the system content window will pop up. Click the environment variable button in the 4th label named Advanced, as shown in the figure below:
The Jingjing variable window appears. Please click Path in the system variable pane below. Press the edit button. The edit system variable window will appear. Please add ";C:AppServ\php" to the variable value field at the end. Please note that there must be a semicolon (";") before "C:". After editing, press the OK button to close the window, as shown in the figure below:
Just complete this step and you can use instructions to manage the PEAR suite.
Let's do a test, please select "Start/All Programs (Program Sets)/Affiliated Applications/Command Prompt Characters". Enter after >:
After pressing the Enter key on the keyboard, all PEAR management instructions and instructions will appear, as shown in the following screen:
Note: PEAR commands can be used in both uppercase and lowercase in Windows systems.
I will try other instructions based on the description in the figure above. For example, to display all installed kits, just enter "pear list", and the name, kit number, and kit status of the currently installed kit will appear on the screen
The command is invalid? Don't worry, if you find the command invalid, just find the file under C:WINDOWS and open it with any Chinese text editor, change the original "register_argc_argv=OFF" to "register_argc_argv=ON". After archive, close the command prompt character window and reopen it, and you can use the PEAR command without barriers.
You can install it. Please note that the package name can be used in case. If the package status is stable, you do not need to enter the package number. For example: I want to install the benchmark suite, just enter
When "install ok: Benchmark 1.2.1" appears on the last line, it means that the installation is successful.
But what should I do if there is a dependency problem during installation and the installation fails? For example, when I install the Html_QuickForm package. There was a message that I needed to install the Html_Common suite first, so I had to enter "pear install html_common" again. This command finally showed the word "install ok".
Then install the Html_QuickForm kit, as shown in the figure below, and you will be done
If you are installing a Beta or Alpha version, that is, a trial version of the package, please enter the complete package version number after pear install. For example, if you want to install the liveuser suite, but the package does not currently release the stable version, you need to use the following instructions:
That is, the package version number must be added to the package name. Everyone will ask, how can I know the package version number? Please check the PEAR official website. If the installed kit is not Stable and the kit number is not filled in, the "install non-Stable version" error message will appear during installation and the installation will be stopped.
A good way to be lazy: If you must install a certain suite, no matter whether it is sufficiently stable or beta, you can use a command:
For example, if you want to install the liveuser suite and are too lazy to check the version number, then use this command
The "-f" in the command represents the forced meaning of "force", which means that you need to install it no matter what.
Remove PEAR kit with instructions
Removing a kit is much easier than installing it, just enter:
This is the command, as shown in the figure below: Suppose I will remove the benchmark suite named as shown in the figure below:
The final appearance of "uninstall ok" means that the removal of the kit has been successful. The probability of the removal of the kit is very low, please rest assured.
Upgrade PEAR kit with instructions
New versions of the kit will be released constantly. To upgrade the old kit to a new kit is also very simple. You only need to enter the instructions:
That's it, for example: If I want to upgrade a kit called cache, just enter:
That's it. The upgrade process is the same as the installation kit. Sometimes there will be dependency problems and the upgrade fails. At this time, just install the dependency kit first.
Other instructions are rarely used, so I will not introduce them here, please watch them yourself. As long as you enter the pear command in the command prompt character window, the instructions will appear.
Modify file
This is the last job before PEAR. Whether you use the web interface or use instructions to manage the suite, you need to modify the file. This file is placed in the C:WINDOWS directory. Please use the text editor to open it and add a line of words as follows:
After joining, remember to archive and re-execute Apache, and that's all. You should see that the value of include_path is the path to download and install the PEAR suite, but why should I join this line? The author will explain it in the next chapter.
Let's check whether adding this line has changed the setting value. Please create a file in c:AppServ\www, and only one line is written in the file:
Then enter http;//127.0.0.1/ or http;//localhost/ in the browser
In addition, I also suggest that the value of the allowcall_time_passreference setting in the file is changed to On, and I will explain the reason in Chapter 6.
If all the actions are not wrong and the picture appears as shown in the picture above, then prepare to enjoy the perfect experience of doubling PHP skills brought by PEAR.
There are two ways to install and manage a suite under the Windows operating system. One is to use the web management interface, and the other is to use the "kit instructions". The author recommends the latter because it executes faster, but if you are afraid of instructions, you can also use the first one to easily manage the suite.
Use web interface management suite
Web Suite Management When installing the basic suite in the previous unit. It's already installed by the way. After installing the PEAR basic suite in the previous unit, the Start Web Rrontend of the PEAR instoller>> link will appear at the bottom. Click to enter the web interface of the suite management, as shown below:
The location of the management interface webpage file is the 9th setting item of the previous unit Filename of WebFrontend. The example I use is to set it to c:AppServ\www\, remember to add it to my favorite. In addition, previous blocks can be deleted.
Please note that there are 3 links above the picture above, which represent the meanings of list installed packages, list all packages, and list not installed packages.
When entering the suite management web interface, the screen appears with the installed suite name, the summary description of the suite functions and the version number of the suite. Local represents the number of the currently installed version, and Latest represents the number of the latest version on the PEAR official website.
If the current version is not installed, an upgrade pattern will appear. Press the pattern to upgrade the kit. If the recycle barrel pattern next to the version number is pressed, the kit will be removed. Please pay special attention.
Then we enter the screen that shows the kit not installed yet
The same is true for the screen that displays the installed kit. Compared with the same thing, there is no trash can pattern. It was replaced by an old pattern, which means that the user can install the kit by just pressing the pattern.
Installation failed? What should users do when installing?
Usually, the problem of installation failure lies in the "dependence" of the kit. What is "dependence"? Simply put, some kits need to be installed with other kits before they can be used, so you must first install the dependent kit before installing this kit. You can click the recycling barrel pattern in the screen to view the detailed information of the kit, which will mention other kits that are dependent on the kit. As shown in the figure below:
For example: In the above picture, before installing the Cache kit, I click the (!+) pattern to view the detailed information of the kit, and found in the bottom Packages that depend on the Cache kit, five suites such as Net_Dict and Image Graph are dependent on the Cache kit, so you must first install the cache kit before you can install these 5 suites. Otherwise, installing these kits directly will cause a message window of "installation failed".
The management of suites is really simple and convenient to use the web interface, but the speed is a bit slow, and web users must have write permissions to the folder where the suite is placed (this example is c:AppServ\php\PEAR).
The author recommends another management method. The reason for the recommendation is that it downloads the suite faster and has stronger management functions, but the disadvantage is that it requires commands.
Manage PEAR suite with instructions
First of all, like the previous method, you need to use a web page to install the basic suite. Although the web suite management interface is available after installation, the user is asked to prepare instead of using it. Then go to the My Computer pattern on the desktop, press the right click, and the menu appears. Please select "Content" and the system content window will pop up. Click the environment variable button in the 4th label named Advanced, as shown in the figure below:
The Jingjing variable window appears. Please click Path in the system variable pane below. Press the edit button. The edit system variable window will appear. Please add ";C:AppServ\php" to the variable value field at the end. Please note that there must be a semicolon (";") before "C:". After editing, press the OK button to close the window, as shown in the figure below:
Just complete this step and you can use instructions to manage the PEAR suite.
Let's do a test, please select "Start/All Programs (Program Sets)/Affiliated Applications/Command Prompt Characters". Enter after >:
After pressing the Enter key on the keyboard, all PEAR management instructions and instructions will appear, as shown in the following screen:
Note: PEAR commands can be used in both uppercase and lowercase in Windows systems.
I will try other instructions based on the description in the figure above. For example, to display all installed kits, just enter "pear list", and the name, kit number, and kit status of the currently installed kit will appear on the screen
The command is invalid? Don't worry, if you find the command invalid, just find the file under C:WINDOWS and open it with any Chinese text editor, change the original "register_argc_argv=OFF" to "register_argc_argv=ON". After archive, close the command prompt character window and reopen it, and you can use the PEAR command without barriers.
You can install it. Please note that the package name can be used in case. If the package status is stable, you do not need to enter the package number. For example: I want to install the benchmark suite, just enter
When "install ok: Benchmark 1.2.1" appears on the last line, it means that the installation is successful.
But what should I do if there is a dependency problem during installation and the installation fails? For example, when I install the Html_QuickForm package. There was a message that I needed to install the Html_Common suite first, so I had to enter "pear install html_common" again. This command finally showed the word "install ok".
Then install the Html_QuickForm kit, as shown in the figure below, and you will be done
If you are installing a Beta or Alpha version, that is, a trial version of the package, please enter the complete package version number after pear install. For example, if you want to install the liveuser suite, but the package does not currently release the stable version, you need to use the following instructions:
That is, the package version number must be added to the package name. Everyone will ask, how can I know the package version number? Please check the PEAR official website. If the installed kit is not Stable and the kit number is not filled in, the "install non-Stable version" error message will appear during installation and the installation will be stopped.
A good way to be lazy: If you must install a certain suite, no matter whether it is sufficiently stable or beta, you can use a command:
For example, if you want to install the liveuser suite and are too lazy to check the version number, then use this command
The "-f" in the command represents the forced meaning of "force", which means that you need to install it no matter what.
Remove PEAR kit with instructions
Removing a kit is much easier than installing it, just enter:
This is the command, as shown in the figure below: Suppose I will remove the benchmark suite named as shown in the figure below:
The final appearance of "uninstall ok" means that the removal of the kit has been successful. The probability of the removal of the kit is very low, please rest assured.
Upgrade PEAR kit with instructions
New versions of the kit will be released constantly. To upgrade the old kit to a new kit is also very simple. You only need to enter the instructions:
That's it, for example: If I want to upgrade a kit called cache, just enter:
That's it. The upgrade process is the same as the installation kit. Sometimes there will be dependency problems and the upgrade fails. At this time, just install the dependency kit first.
Other instructions are rarely used, so I will not introduce them here, please watch them yourself. As long as you enter the pear command in the command prompt character window, the instructions will appear.
Modify file
This is the last job before PEAR. Whether you use the web interface or use instructions to manage the suite, you need to modify the file. This file is placed in the C:WINDOWS directory. Please use the text editor to open it and add a line of words as follows:
After joining, remember to archive and re-execute Apache, and that's all. You should see that the value of include_path is the path to download and install the PEAR suite, but why should I join this line? The author will explain it in the next chapter.
Let's check whether adding this line has changed the setting value. Please create a file in c:AppServ\www, and only one line is written in the file:
Then enter http;//127.0.0.1/ or http;//localhost/ in the browser
In addition, I also suggest that the value of the allowcall_time_passreference setting in the file is changed to On, and I will explain the reason in Chapter 6.
If all the actions are not wrong and the picture appears as shown in the picture above, then prepare to enjoy the perfect experience of doubling PHP skills brought by PEAR.