PHP性能优化准备篇图解PEAR安装

PEAR是PHP扩展与应用库(the PHP Extension and Application Repository)的缩写。它是一个PHP扩展及应用的一个代码仓库,简单地说,PEAR就是PHP的CPAN。

PEAR提供了丰富的PHP扩展工具类,简单易用,可用于各个项目之中。Benchmark是PEAR的一个扩展包,提供Timer、Iterate和Profiler三个工具类,可用于性能优化过程中的断点调试获取代码的执行时间。

打开源码安装的PHP根目录,如C:\Program Files\PHP5\PHP-5.2.6\,双击go-pear.bat文件,图解安装过程如下

<aPHP-performance-install-pear-01 src="https://files.jb51.cc/file_images/article/201112/201112052253112.png">


<aPHP-performance-install-pear-02 src="https://files.jb51.cc/file_images/article/201112/201112052253113.png">


<aPHP-performance-install-pear-03 src="https://files.jb51.cc/file_images/article/201112/201112052253114.png">


<aPHP-performance-install-pear-04 src="https://files.jb51.cc/file_images/article/201112/201112052253115.png">


<aPHP-performance-install-pear-05 src="https://files.jb51.cc/file_images/article/201112/201112052253116.png">


<aPHP-performance-install-pear-06 src="https://files.jb51.cc/file_images/article/201112/201112052253117.png">


<aPHP-performance-install-pear-07 src="https://files.jb51.cc/file_images/article/201112/201112052253118.png">

这样,PEAR就安装成功,安装过程基本上只需要按Enter键即可,非常简单。

访问:http://pear.PHP.net/ 搜索 benchmark(1)DOS命令安装Benchmark工具类
输入如下命令
>pear install Benchmark-1.2.7

<aPHP-performance-install-pear-08 src="https://files.jb51.cc/file_images/article/201112/201112052253119.png">

如:C:\Program Files\PHP5\PHP-5.2.6>pear install Benchmark-1.2.7
安装成功后直接访问PEAR目录,如C:\Program Files\PHP5\PHP-5.2.6\PEAR

(2)直接下载Benchmark工具类文件

下载地址:
Benchmark:
直接下载解压存在PEAR目录下,如C:\Program Files\PHP5\PHP-5.2.6\PEAR这里只讨论PEAR安装,并以Benchmark工具包为例讨论如何使用PEAR下载和安装工具类包。下一期将讨论如何使用Benchmark工具类断点调试获取代码的执行时间和函数执行的平均时间。

CPAN是什么?


CPAN是一个巨大的PERL的扩展模块仓库,编写的应用模块可以放在CPAN下面的适当的分类目录下面,其他的人可以很方便地复用,当然,你编写应用模块时候也需要遵守其中的准则

PEAR
PEAR简介:

相关文章

统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...
统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...
前言 之前做了微信登录,所以总结一下微信授权登录并获取用户...
FastAdmin是我第一个接触的后台管理系统框架。FastAdmin是一...
之前公司需要一个内部的通讯软件,就叫我做一个。通讯软件嘛...
统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...