PHP performance optimization preparation illustration PEAR Installation

Source: Internet
Author: User
This is the first phase of the PHP performance optimization series. How to install PEAR in a Windows environment and use the Benchmark tool class as an example to explain how to install the extension class for PEAR.

This is the first phase of the PHP performance optimization series. How to install PEAR in a Windows environment and use the Benchmark tool class as an example to explain how to install the extension class for PEAR.



PEAR is the abbreviation of the PHP Extension and Application Repository. It is a code repository for PHP extensions and applications. In short, PEAR is the CPAN of PHP.



PEAR provides a wide range of PHP extension tools, which are easy to use and can be used in various projects. Benchmark is an extension package of PEAR. It provides three tool classes: Timer, Iterate, and Profiler. It can be used for breakpoint debugging during performance optimization to obtain the code execution time.



Open the source code installed PHP root directory, such as C: \ Program Files \ php5 \ php-5.2.6 \, double-click the go-pear.bat file, the installation process is illustrated as follows










In this way, PEAR is successfully installed. Basically, you only need to press Enter during the installation process, which is very simple.



Visit: http://pear.php.net/search for benchmark

(1) install the Benchmark tool class using the doscommand
Enter the following command
> Pear install Benchmark-1.2.7




For example: C: \ Program Files \ php5 \ php-5.2.6> pear install Benchmark-1.2.7
Directly access the PEAR directory after installation, such as C: \ Program Files \ php5 \ php-5.2.6 \ PEAR

(2) directly download the Benchmark tool File

:
Benchmark:

Directly download and unzip the PEAR directory, such as C: \ Program Files \ php5 \ php-5.2.6 \ PEAR

Here we will only discuss PEAR installation, and use the Benchmark Toolkit as an example to discuss how to use PEAR to download and install the tool package. In the next issue, we will discuss how to use the Benchmark tool to obtain the code execution time and the average function execution time.



What is CPAN?
CPAN is a huge extension module repository of PERL. The application modules written can be placed under the appropriate classification directory under CPAN. Other people can reuse them conveniently. Of course, you also need to follow the rules when writing the application module.



PEAR
PEAR introduction:

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.