国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 網站 > 幫助中心 > 正文

windows wamp中配置安裝xhprof步驟

2024-07-09 22:39:13
字體:
來源:轉載
供稿:網友

1.下載在這里 http://dev.freshsite.pl/php-extensions/xhprof.html.

我使用的是wamp 2.2d 32位的,這里羅嗦一句,既然用windows的wamp了,就不要裝64位了,畢竟都是開發環境,正式環境肯定是32位的,這里下載兩個文件 XHProf 0.10.3 for PHP 5.3 vc9.zip xhprof_html.zip

2.安裝,這步驟很簡單,把XHProf 0.10.3 for PHP 5.3 vc9.zip里面的dll文件重命名為 php_xhprof.dll 放在php的ext目錄下,然后在php.ini配置里面加入配置,不要忘記創建對應的文件夾,代碼如下:

  1. [xhprof] 
  2. extension=php_xhprof.dll 
  3. ; directory used by default implementation of the iXHProfRuns 
  4. ; interface (namely, the XHProfRuns_Default class) for storing 
  5. ; XHProf runs. 
  6. xhprof.output_dir=”d:/wamp/logs/xhprof_log” 

重啟你的wamp即可,看看phpinfo()里面有沒有對應的文件.

3.使用:xhprof_html.zip 這個文件解壓到你想測試的網站根目錄就好了,現在網站一般使用的是框架,唯一入口這點最好了,直接在index.php里面寫就好了,我用的是yaf框架,代碼如下:

  1. xhprof_enable();//開始 
  2. require 'init.php'
  3. require 'conf/db.inc.php'
  4. $app = new Yaf_Application(BASE_PATH . "/conf/itxiangqin.ini"); 
  5. Yaf_Registry::set('config', Yaf_Application::app()->getConfig()); 
  6. $app->bootstrap()->run(); 
  7. $xhprof_data = xhprof_disable();//結束,然后寫入文件,注意目錄 
  8. $XHPROF_ROOT = realpath(dirname(__FILE__).'/xhprof'); 
  9. include_once $XHPROF_ROOT . "/xhprof_lib/utils/xhprof_lib.php"
  10. include_once $XHPROF_ROOT . "/xhprof_lib/utils/xhprof_runs.php"
  11. //開源代碼Vevb.com 
  12. // save raw data for this profiler run using default 
  13. // implementation of iXHProfRuns. 
  14. $xhprof_runs = new XHProfRuns_Default(); 
  15.  
  16. // save the run under a namespace "xhprof_foo" 
  17. $run_id = $xhprof_runs->save_run($xhprof_data"xhprof_foo"); 
  18. echo "<a href='http://www.pztai.com/xhprof/xhprof_html/?run=$run_id&source=xhprof_foo'>分析</a>";// 

這里的pztai換成你自己的域名就好了,本地就localhost分析</a>";//這里的pztai換成你自己的域名就好了,本地就localhost.

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 江门市| 张掖市| 清苑县| 建昌县| 泸州市| 灵台县| 崇义县| 明水县| 临高县| 城口县| 红原县| 子长县| 澜沧| 武定县| 金堂县| 贵溪市| 株洲县| 五莲县| 霍林郭勒市| 石狮市| 印江| 南城县| 丹巴县| 谢通门县| 新密市| 平昌县| 密云县| 罗江县| 郴州市| 潮安县| 镇康县| 荣昌县| 大埔县| 滕州市| 瓦房店市| 宜宾县| 甘泉县| 安多县| 土默特右旗| 隆回县| 会宁县|