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. What is 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.

Why is PEAR installed?

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.

How to install PEAR

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.

How to install the Benchmark class

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

: Http://pear.php.net/package/Benchmark/download
Benchmark: http://download.pear.php.net/package/Benchmark-1.2.7.tgz

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.

Other instructions

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.

References

PEAR http://pear.php.net/
PEAR introduction: Use PEAR to write your next php program

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.