Table des matières
1. 安装与配置
2.性能分析与日志记录
3.日志分析
4.扩展阅读
Maison développement back-end tutoriel php 【PHP】替项目引入函数级的性能监控

【PHP】替项目引入函数级的性能监控

Jun 13, 2016 am 11:17 AM
data nbsp php

【PHP】为项目引入函数级的性能监控

  作者:zhanhailiang 日期:2013-03-18
Copier après la connexion

使用PHP扩展Xhprof来实现函数级的性能监控。

引用官方对Xhprof的描述:

XHProf is a function-level hierarchical profiler for PHP and has a simple HTML based navigational interface. The raw data collection component is implemented in C (as a PHP extension). The reporting/UI layer is all in PHP. It is capable of reporting function-level inclusive and exclusive wall times, memory usage, CPU times and number of calls for each function. Additionally, it supports ability to compare two runs (hierarchical DIFF reports), or aggregate results from multiple runs.

提供函数级别的性能信息,例如调用次数,其中包括阻塞时间,内存使用情况和CPU时间。

1. 安装与配置

<span class="sy0" style="color:rgb(102,204,102)">/</span>data<span class="sy0" style="color:rgb(102,204,102)">/</span>software <span class="co0" style="color:rgb(128,128,128); font-style:italic"># wget http://pecl.php.net/get/xhprof-0.9.2.tgz</span><span class="sy0" style="color:rgb(102,204,102)">/</span>data<span class="sy0" style="color:rgb(102,204,102)">/</span>software <span class="co0" style="color:rgb(128,128,128); font-style:italic"># tar zxvf xhprof-0.9.2.tgz</span><span class="sy0" style="color:rgb(102,204,102)">/</span>data<span class="sy0" style="color:rgb(102,204,102)">/</span>software <span class="co0" style="color:rgb(128,128,128); font-style:italic"># cd xhprof-0.9.2/</span><span class="sy0" style="color:rgb(102,204,102)">/</span>data<span class="sy0" style="color:rgb(102,204,102)">/</span>software<span class="sy0" style="color:rgb(102,204,102)">/</span>xhprof-0.9.2 <span class="co0" style="color:rgb(128,128,128); font-style:italic"># ls -alp</span>总计 <span class="nu0" style="color:rgb(204,102,204)">968</span>drwxr-xr-x  <span class="nu0" style="color:rgb(204,102,204)">6</span> root root    <span class="nu0" style="color:rgb(204,102,204)">4096</span> <span class="nu0" style="color:rgb(204,102,204)">2013</span>-03-<span class="nu0" style="color:rgb(204,102,204)">18</span> 09:09 .<span class="sy0" style="color:rgb(102,204,102)">/</span>drwxr-xr-x <span class="nu0" style="color:rgb(204,102,204)">47</span> root root    <span class="nu0" style="color:rgb(204,102,204)">8192</span> <span class="nu0" style="color:rgb(204,102,204)">2013</span>-03-<span class="nu0" style="color:rgb(204,102,204)">18</span> 09:09 ..<span class="sy0" style="color:rgb(102,204,102)">/</span><span class="re5">-rw-r--r--</span>  <span class="nu0" style="color:rgb(204,102,204)">1</span> <span class="nu0" style="color:rgb(204,102,204)">1425</span> <span class="kw2" style="color:rgb(0,0,0); font-weight:bold">users</span>   <span class="nu0" style="color:rgb(204,102,204)">3359</span> <span class="nu0" style="color:rgb(204,102,204)">2009</span>-06-02 01:<span class="nu0" style="color:rgb(204,102,204)">52</span> CHANGELOG<span class="re5">-rw-r--r--</span>  <span class="nu0" style="color:rgb(204,102,204)">1</span> <span class="nu0" style="color:rgb(204,102,204)">1425</span> <span class="kw2" style="color:rgb(0,0,0); font-weight:bold">users</span>    <span class="nu0" style="color:rgb(204,102,204)">266</span> <span class="nu0" style="color:rgb(204,102,204)">2009</span>-06-02 01:<span class="nu0" style="color:rgb(204,102,204)">52</span> CREDITSdrwxr-xr-x  <span class="nu0" style="color:rgb(204,102,204)">2</span> root root    <span class="nu0" style="color:rgb(204,102,204)">4096</span> <span class="nu0" style="color:rgb(204,102,204)">2013</span>-03-<span class="nu0" style="color:rgb(204,102,204)">18</span> 09:09 examples<span class="sy0" style="color:rgb(102,204,102)">/</span>       <span class="co0" style="color:rgb(128,128,128); font-style:italic"># demo</span>drwxr-xr-x  <span class="nu0" style="color:rgb(204,102,204)">8</span> root root    <span class="nu0" style="color:rgb(204,102,204)">4096</span> <span class="nu0" style="color:rgb(204,102,204)">2013</span>-03-<span class="nu0" style="color:rgb(204,102,204)">18</span> 09:09 extension<span class="sy0" style="color:rgb(102,204,102)">/</span>      <span class="co0" style="color:rgb(128,128,128); font-style:italic"># pecl </span><span class="re5">-rw-r--r--</span>  <span class="nu0" style="color:rgb(204,102,204)">1</span> <span class="nu0" style="color:rgb(204,102,204)">1425</span> <span class="kw2" style="color:rgb(0,0,0); font-weight:bold">users</span>  <span class="nu0" style="color:rgb(204,102,204)">10174</span> <span class="nu0" style="color:rgb(204,102,204)">2009</span>-06-02 01:<span class="nu0" style="color:rgb(204,102,204)">52</span> LICENSE<span class="re5">-rw-r--r--</span>  <span class="nu0" style="color:rgb(204,102,204)">1</span> <span class="nu0" style="color:rgb(204,102,204)">1425</span> <span class="kw2" style="color:rgb(0,0,0); font-weight:bold">users</span>    <span class="nu0" style="color:rgb(204,102,204)">186</span> <span class="nu0" style="color:rgb(204,102,204)">2009</span>-06-02 01:<span class="nu0" style="color:rgb(204,102,204)">52</span> README<span class="re5">-rw-r--r--</span>  <span class="nu0" style="color:rgb(204,102,204)">1</span> root root  <span class="nu0" style="color:rgb(204,102,204)">931660</span> <span class="nu0" style="color:rgb(204,102,204)">2009</span>-06-02 01:<span class="nu0" style="color:rgb(204,102,204)">55</span> xhprofdrwxr-xr-x  <span class="nu0" style="color:rgb(204,102,204)">6</span> root root    <span class="nu0" style="color:rgb(204,102,204)">4096</span> <span class="nu0" style="color:rgb(204,102,204)">2013</span>-03-<span class="nu0" style="color:rgb(204,102,204)">18</span> 09:09 xhprof_html<span class="sy0" style="color:rgb(102,204,102)">/</span>     <span class="co0" style="color:rgb(128,128,128); font-style:italic"># 自带的界面包</span>drwxr-xr-x  <span class="nu0" style="color:rgb(204,102,204)">4</span> root root    <span class="nu0" style="color:rgb(204,102,204)">4096</span> <span class="nu0" style="color:rgb(204,102,204)">2013</span>-03-<span class="nu0" style="color:rgb(204,102,204)">12</span> <span class="nu0" style="color:rgb(204,102,204)">15</span>:<span class="nu0" style="color:rgb(204,102,204)">40</span> xhprof_lib<span class="sy0" style="color:rgb(102,204,102)">/</span>      <span class="co0" style="color:rgb(128,128,128); font-style:italic"># 函数库</span><span class="sy0" style="color:rgb(102,204,102)">/</span>data<span class="sy0" style="color:rgb(102,204,102)">/</span>software<span class="sy0" style="color:rgb(102,204,102)">/</span>xhprof-0.9.2 <span class="co0" style="color:rgb(128,128,128); font-style:italic"># cd extension/</span><span class="sy0" style="color:rgb(102,204,102)">/</span>data<span class="sy0" style="color:rgb(102,204,102)">/</span>software<span class="sy0" style="color:rgb(102,204,102)">/</span>xhprof-0.9.2<span class="sy0" style="color:rgb(102,204,102)">/</span>extension <span class="co0" style="color:rgb(128,128,128); font-style:italic"># phpize </span><span class="sy0" style="color:rgb(102,204,102)">/</span>data<span class="sy0" style="color:rgb(102,204,102)">/</span>software<span class="sy0" style="color:rgb(102,204,102)">/</span>xhprof-0.9.2<span class="sy0" style="color:rgb(102,204,102)">/</span>extension <span class="co0" style="color:rgb(128,128,128); font-style:italic"># ./configure --with-php-config=/usr/local/services/php/bin/php-config --enable-xhprof</span><span class="sy0" style="color:rgb(102,204,102)">/</span>data<span class="sy0" style="color:rgb(102,204,102)">/</span>software<span class="sy0" style="color:rgb(102,204,102)">/</span>xhprof-0.9.2<span class="sy0" style="color:rgb(102,204,102)">/</span>extension <span class="co0" style="color:rgb(128,128,128); font-style:italic"># make</span><span class="sy0" style="color:rgb(102,204,102)">/</span>data<span class="sy0" style="color:rgb(102,204,102)">/</span>software<span class="sy0" style="color:rgb(102,204,102)">/</span>xhprof-0.9.2<span class="sy0" style="color:rgb(102,204,102)">/</span>extension <span class="co0" style="color:rgb(128,128,128); font-style:italic"># make install</span>Installing shared extensions:     <span class="sy0" style="color:rgb(102,204,102)">/</span>usr<span class="sy0" style="color:rgb(102,204,102)">/</span>local<span class="sy0" style="color:rgb(102,204,102)">/</span>services<span class="sy0" style="color:rgb(102,204,102)">/</span>php<span class="sy0" style="color:rgb(102,204,102)">/</span>lib<span class="sy0" style="color:rgb(102,204,102)">/</span>php<span class="sy0" style="color:rgb(102,204,102)">/</span>extensions<span class="sy0" style="color:rgb(102,204,102)">/</span>no-debug-non-zts-<span class="nu0" style="color:rgb(204,102,204)">20090626</span><span class="sy0" style="color:rgb(102,204,102)">/</span><span class="sy0" style="color:rgb(102,204,102)">/</span>data<span class="sy0" style="color:rgb(102,204,102)">/</span>software<span class="sy0" style="color:rgb(102,204,102)">/</span>xhprof-0.9.2<span class="sy0" style="color:rgb(102,204,102)">/</span>extension <span class="co0" style="color:rgb(128,128,128); font-style:italic"># cp /usr/local/services/php/lib/php/extensions/no-debug-non-zts-20090626/xhprof.so /usr/local/services/php/extensions/</span><span class="co0" style="color:rgb(128,128,128); font-style:italic"># 将生成的xhprof.so复制到extension_dir目录下,配置php.ini,重启php-fpm或服务器即可</span> <span class="sy0" style="color:rgb(102,204,102)">//</span> php.ini<span class="br0" style="color:rgb(102,204,102)">[</span>xhprof<span class="br0" style="color:rgb(102,204,102)">]</span><span class="re2" style="color:rgb(0,0,255)">extension</span>=xhprof.soxhprof.output_dir=<span class="st0" style="color:rgb(255,0,0)">"/data/logs/servers/xhprof"</span> <span class="co0" style="color:rgb(128,128,128); font-style:italic"># 检查xhprof是否加载</span><span class="sy0" style="color:rgb(102,204,102)">/</span>data<span class="sy0" style="color:rgb(102,204,102)">/</span>software<span class="sy0" style="color:rgb(102,204,102)">/</span>xhprof-0.9.2<span class="sy0" style="color:rgb(102,204,102)">/</span>extension <span class="co0" style="color:rgb(128,128,128); font-style:italic"># php -m|grep xhprof</span>xhprof
Copier après la connexion

2.性能分析与日志记录

首先添加如下代码,以便记录十分之一的请求的性能分析日志(日志记录在/data/logs/servers/xhprof):

<span class="re0" style="color:rgb(0,0,255)">$xhprofEnabled</span> <span class="sy0" style="color:rgb(102,204,102)">=</span> <span class="kw4" style="color:rgb(153,51,51)">FALSE</span><span class="sy0" style="color:rgb(102,204,102)">;</span><span class="kw1" style="color:rgb(177,177,0)">if</span><span class="br0" style="color:rgb(102,204,102)">(</span><span class="kw3" style="color:rgb(0,0,102)">extension_loaded</span><span class="br0" style="color:rgb(102,204,102)">(</span><span class="st_h">'xhprof'</span><span class="br0" style="color:rgb(102,204,102)">)</span> <span class="sy0" style="color:rgb(102,204,102)">&&</span> <span class="kw3" style="color:rgb(0,0,102)">mt_rand</span><span class="br0" style="color:rgb(102,204,102)">(</span><span class="nu0" style="color:rgb(204,102,204)">1</span><span class="sy0" style="color:rgb(102,204,102)">,</span> <span class="nu0" style="color:rgb(204,102,204)">10</span><span class="br0" style="color:rgb(102,204,102)">)</span> <span class="sy0" style="color:rgb(102,204,102)">===</span> <span class="nu0" style="color:rgb(204,102,204)">1</span><span class="br0" style="color:rgb(102,204,102)">)</span> <span class="br0" style="color:rgb(102,204,102)">{</span> <span class="co1" style="color:rgb(128,128,128); font-style:italic">// 分析十分之一的请求性能</span>    <span class="co1" style="color:rgb(128,128,128); font-style:italic">// 开启性能监测</span>    xhprof_enable<span class="br0" style="color:rgb(102,204,102)">(</span><span class="coMULTI" style="color:rgb(128,128,128); font-style:italic">/*XHPROF_FLAGS_CPU &#43; */</span>XHPROF_FLAGS_MEMORY <span class="sy0" style="color:rgb(102,204,102)">&#43;</span> XHPROF_FLAGS_NO_BUILTINS <span class="br0" style="color:rgb(102,204,102)">)</span><span class="sy0" style="color:rgb(102,204,102)">;</span>    <span class="re0" style="color:rgb(0,0,255)">$xhprofEnabled</span> <span class="sy0" style="color:rgb(102,204,102)">=</span> <span class="kw4" style="color:rgb(153,51,51)">TRUE</span><span class="sy0" style="color:rgb(102,204,102)">;</span><span class="br0" style="color:rgb(102,204,102)">}</span>
Copier après la connexion

接着注册请求结束处理器,以便请求结束时记录下xhprof性能分析日志:

<span class="kw2" style="color:rgb(0,0,0); font-weight:bold">function</span><span style="color:#333333"> profile_record</span><span class="br0" style="color:rgb(102,204,102)">(</span><span class="br0" style="color:rgb(102,204,102)">)</span><span style="color:#333333"> </span><span class="br0" style="color:rgb(102,204,102)">{</span><span style="color:#333333">    </span><span class="kw1" style="color:rgb(177,177,0)">if</span><span class="br0" style="color:rgb(102,204,102)">(</span><span class="kw3" style="color:rgb(0,0,102)">isset</span><span class="br0" style="color:rgb(102,204,102)">(</span><span class="re0" style="color:rgb(0,0,255)">$GLOBALS</span><span class="br0" style="color:rgb(102,204,102)">[</span><span class="st_h" style="color:rgb(51,51,51)">'xhprofEnabled'</span><span class="br0" style="color:rgb(102,204,102)">]</span><span class="br0" style="color:rgb(102,204,102)">)</span><span style="color:#333333"> </span><span class="sy0" style="color:rgb(102,204,102)">&&</span><span style="color:#333333"> </span><span class="re0" style="color:rgb(0,0,255)">$GLOBALS</span><span class="br0" style="color:rgb(102,204,102)">[</span><span class="st_h" style="color:rgb(51,51,51)">'xhprofEnabled'</span><span class="br0" style="color:rgb(102,204,102)">]</span><span class="br0" style="color:rgb(102,204,102)">)</span><span style="color:#333333"> </span><span class="br0" style="color:rgb(102,204,102)">{</span><span style="color:#333333">        </span><span class="re0" style="color:rgb(0,0,255)">$xhprof_data</span><span style="color:#333333"> </span><span class="sy0" style="color:rgb(102,204,102)">=</span><span style="color:#333333"> xhprof_disable</span><span class="br0" style="color:rgb(102,204,102)">(</span><span class="br0" style="color:rgb(102,204,102)">)</span><span class="sy0" style="color:rgb(102,204,102)">;</span><span style="color:#333333">         </span><span class="re0" style="color:rgb(0,0,255)">$path</span><span style="color:#333333"> </span><span class="sy0" style="color:rgb(102,204,102)">=</span><span style="color:#333333"> </span><span class="re0" style="color:rgb(0,0,255)">$_SERVER</span><span class="br0" style="color:rgb(102,204,102)">[</span><span class="st_h" style="color:rgb(51,51,51)">'PHP_SELF'</span><span class="br0" style="color:rgb(102,204,102)">]</span><span class="sy0" style="color:rgb(102,204,102)">;</span><span style="color:#333333">        </span><span class="kw1" style="color:rgb(177,177,0)">if</span><span class="br0" style="color:rgb(102,204,102)">(</span><span class="re0" style="color:rgb(0,0,255)">$pos</span><span style="color:#333333"> </span><span class="sy0" style="color:rgb(102,204,102)">=</span><span style="color:#333333"> </span><span class="kw3" style="color:rgb(0,0,102)">strpos</span><span class="br0" style="color:rgb(102,204,102)">(</span><span class="re0" style="color:rgb(0,0,255)">$path</span><span class="sy0" style="color:rgb(102,204,102)">,</span><span style="color:#333333"> </span><span class="st_h" style="color:rgb(51,51,51)">'/htdocs'</span><span class="br0" style="color:rgb(102,204,102)">)</span><span class="br0" style="color:rgb(102,204,102)">)</span><span style="color:#333333"> </span><span class="br0" style="color:rgb(102,204,102)">{</span><span style="color:#333333">            </span><span class="re0" style="color:rgb(0,0,255)">$path</span><span style="color:#333333"> </span><span class="sy0" style="color:rgb(102,204,102)">=</span><span style="color:#333333"> </span><span class="kw3" style="color:rgb(0,0,102)">substr</span><span class="br0" style="color:rgb(102,204,102)">(</span><span class="re0" style="color:rgb(0,0,255)">$path</span><span class="sy0" style="color:rgb(102,204,102)">,</span><span style="color:#333333"> </span><span class="re0" style="color:rgb(0,0,255)">$pos</span><span class="sy0" style="color:rgb(102,204,102)">&#43;</span><span class="nu0" style="color:rgb(204,102,204)">7</span><span class="br0" style="color:rgb(102,204,102)">)</span><span class="sy0" style="color:rgb(102,204,102)">;</span><span style="color:#333333">        </span><span class="br0" style="color:rgb(102,204,102)">}</span><span style="color:#333333">        </span><span class="re0" style="color:rgb(0,0,255)">$basename</span><span style="color:#333333"> </span><span class="sy0" style="color:rgb(102,204,102)">=</span><span style="color:#333333"> </span><span class="kw3" style="color:rgb(0,0,102)">str_replace</span><span class="br0" style="color:rgb(102,204,102)">(</span><span class="kw3" style="color:rgb(0,0,102)">array</span><span class="br0" style="color:rgb(102,204,102)">(</span><span class="st_h" style="color:rgb(51,51,51)">'.'</span><span class="sy0" style="color:rgb(102,204,102)">,</span><span style="color:#333333"> </span><span class="st_h" style="color:rgb(51,51,51)">'/'</span><span class="br0" style="color:rgb(102,204,102)">)</span><span class="sy0" style="color:rgb(102,204,102)">,</span><span style="color:#333333"> </span><span class="st_h" style="color:rgb(51,51,51)">'_'</span><span class="sy0" style="color:rgb(102,204,102)">,</span><span style="color:#333333"> </span><span class="kw3" style="color:rgb(0,0,102)">ltrim</span><span class="br0" style="color:rgb(102,204,102)">(</span><span class="re0" style="color:rgb(0,0,255)">$path</span><span class="sy0" style="color:rgb(102,204,102)">,</span><span style="color:#333333"> </span><span class="st_h" style="color:rgb(51,51,51)">'/'</span><span class="br0" style="color:rgb(102,204,102)">)</span><span class="br0" style="color:rgb(102,204,102)">)</span><span class="sy0" style="color:rgb(102,204,102)">;</span><span style="color:#333333">         </span><span class="coMULTI" style="color:rgb(128,128,128); font-style:italic">/* 官方Demo,请参考下载包里的</span><span class="coMULTI" style="font-style:italic"><span style="color:#ff0000">xhprof-0.9.2/examples/sample.php</span></span><span class="coMULTI" style="color:rgb(128,128,128); font-style:italic">          * //         * // Saving the XHProf run         * // using the default implementation of iXHProfRuns.         * //         * include_once $XHPROF_ROOT . "/xhprof_lib/utils/xhprof_lib.php";         * include_once $XHPROF_ROOT . "/xhprof_lib/utils/xhprof_runs.php";         * $xhprof_runs = new XHProfRuns_Default();         */</span><span style="color:#333333">         </span><span class="re0" style="color:rgb(0,0,255)">$xhprof_runs</span><span style="color:#333333"> </span><span class="sy0" style="color:rgb(102,204,102)">=</span><span style="color:#333333"> </span><span class="kw2" style="color:rgb(0,0,0); font-weight:bold">new</span><span style="color:#333333"> HWSL_XhProfRuns</span><span class="br0" style="color:rgb(102,204,102)">(</span><span class="br0" style="color:rgb(102,204,102)">)</span><span class="sy0" style="color:rgb(102,204,102)">;</span><span style="color:#333333">        </span><span class="co1" style="color:rgb(128,128,128); font-style:italic">// 记录日志时引入时间截,方便比较不同版本间的性能差异</span><span style="color:#333333">        </span><span class="re0" style="color:rgb(0,0,255)">$run_id</span><span style="color:#333333"> </span><span class="sy0" style="color:rgb(102,204,102)">=</span><span style="color:#333333"> </span><span class="re0" style="color:rgb(0,0,255)">$xhprof_runs</span><span class="sy0" style="color:rgb(102,204,102)">-></span><span class="me1" style="color:rgb(0,102,0)">save_run</span><span class="br0" style="color:rgb(102,204,102)">(</span><span class="re0" style="color:rgb(0,0,255)">$xhprof_data</span><span class="sy0" style="color:rgb(102,204,102)">,</span><span style="color:#333333"> </span><span class="st_h" style="color:rgb(51,51,51)">'xhprof_itravel_'</span><span class="sy0" style="color:rgb(102,204,102)">.</span><span class="re0" style="color:rgb(0,0,255)">$basename</span><span class="sy0" style="color:rgb(102,204,102)">.</span><span class="st_h" style="color:rgb(51,51,51)">'_'</span><span class="sy0" style="color:rgb(102,204,102)">.</span><span class="kw3" style="color:rgb(0,0,102)">date</span><span class="br0" style="color:rgb(102,204,102)">(</span><span class="st_h" style="color:rgb(51,51,51)">'YmdHis'</span><span class="br0" style="color:rgb(102,204,102)">)</span><span class="br0" style="color:rgb(102,204,102)">)</span><span class="sy0" style="color:rgb(102,204,102)">;</span><span style="color:#333333">    </span><span class="br0" style="color:rgb(102,204,102)">}</span><span style="color:#333333"></span><span class="br0" style="color:rgb(102,204,102)">}</span><span style="color:#333333"> </span><span class="kw3" style="color:rgb(0,0,102)">register_shutdown_function</span><span class="br0" style="color:rgb(102,204,102)">(</span><span class="st_h" style="color:rgb(51,51,51)">'profile_record'</span><span class="br0" style="color:rgb(102,204,102)">)</span><span class="sy0" style="color:rgb(102,204,102)">;</span>
Copier après la connexion

生成的日志以文件保存在:xhprof.output_dir=”/data/logs/servers/xhprof”

生成的日志文件命名规则为:.

其中命名空间的命名规则定义为:'xhprof_itravel_'.$basename.'_'.date('YmdHis')

$basename记录相应的文件位置,date(‘YmdHis’)记录当前时间戳,以便比较同一文件不同版本间的性能差异。

3.日志分析

然后,通过官方提供的用户界面包xhprof-0.9.2/xhprof_html/来查看运行报告:

要查看run_id是和命名空间是的报告,访问URL:

http:///index.php?run=&source=

其中各列含义如下:

  • Inclusive Time (或子树执行时间) :包括子树执行时间的所有执行时间。
  • Exclusive Time/Self Time :函数执行本身的时间花费。不包括子树执行时间。
  • Wall时间 :又名经过的时间或挂钟时间。
  • CPU时间 : CPU时间在用户空间+ CPU时间在内核空间。

    也可以查看图形化的性能分析报告(其中高亮显示的路径直观反映了函数调用栈中最大的性能损耗路径):

    http:///callgraph.php?run=&source=

    4.扩展阅读

    • 在生产环境中使用php性能测试工具xhprof
    • 关于改善xhprof使用情况的设想
    • XHProf文件(草稿)
Déclaration de ce site Web
Le contenu de cet article est volontairement contribué par les internautes et les droits d'auteur appartiennent à l'auteur original. Ce site n'assume aucune responsabilité légale correspondante. Si vous trouvez un contenu suspecté de plagiat ou de contrefaçon, veuillez contacter admin@php.cn

Outils d'IA chauds

Undresser.AI Undress

Undresser.AI Undress

Application basée sur l'IA pour créer des photos de nu réalistes

AI Clothes Remover

AI Clothes Remover

Outil d'IA en ligne pour supprimer les vêtements des photos.

Undress AI Tool

Undress AI Tool

Images de déshabillage gratuites

Clothoff.io

Clothoff.io

Dissolvant de vêtements AI

AI Hentai Generator

AI Hentai Generator

Générez AI Hentai gratuitement.

Article chaud

R.E.P.O. Crystals d'énergie expliqués et ce qu'ils font (cristal jaune)
3 Il y a quelques semaines By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Meilleurs paramètres graphiques
3 Il y a quelques semaines By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Comment réparer l'audio si vous n'entendez personne
3 Il y a quelques semaines By 尊渡假赌尊渡假赌尊渡假赌
Où trouver la courte de la grue à atomide atomique
1 Il y a quelques semaines By DDD

Outils chauds

Bloc-notes++7.3.1

Bloc-notes++7.3.1

Éditeur de code facile à utiliser et gratuit

SublimeText3 version chinoise

SublimeText3 version chinoise

Version chinoise, très simple à utiliser

Envoyer Studio 13.0.1

Envoyer Studio 13.0.1

Puissant environnement de développement intégré PHP

Dreamweaver CS6

Dreamweaver CS6

Outils de développement Web visuel

SublimeText3 version Mac

SublimeText3 version Mac

Logiciel d'édition de code au niveau de Dieu (SublimeText3)

Configuration du projet CakePHP Configuration du projet CakePHP Sep 10, 2024 pm 05:25 PM

Dans ce chapitre, nous comprendrons les variables d'environnement, la configuration générale, la configuration de la base de données et la configuration de la messagerie dans CakePHP.

Guide d'installation et de mise à niveau de PHP 8.4 pour Ubuntu et Debian Guide d'installation et de mise à niveau de PHP 8.4 pour Ubuntu et Debian Dec 24, 2024 pm 04:42 PM

PHP 8.4 apporte plusieurs nouvelles fonctionnalités, améliorations de sécurité et de performances avec une bonne quantité de dépréciations et de suppressions de fonctionnalités. Ce guide explique comment installer PHP 8.4 ou mettre à niveau vers PHP 8.4 sur Ubuntu, Debian ou leurs dérivés. Bien qu'il soit possible de compiler PHP à partir des sources, son installation à partir d'un référentiel APT comme expliqué ci-dessous est souvent plus rapide et plus sécurisée car ces référentiels fourniront les dernières corrections de bogues et mises à jour de sécurité à l'avenir.

Date et heure de CakePHP Date et heure de CakePHP Sep 10, 2024 pm 05:27 PM

Pour travailler avec la date et l'heure dans cakephp4, nous allons utiliser la classe FrozenTime disponible.

CakePHP travaillant avec la base de données CakePHP travaillant avec la base de données Sep 10, 2024 pm 05:25 PM

Travailler avec la base de données dans CakePHP est très simple. Nous comprendrons les opérations CRUD (Créer, Lire, Mettre à jour, Supprimer) dans ce chapitre.

Téléchargement de fichiers CakePHP Téléchargement de fichiers CakePHP Sep 10, 2024 pm 05:27 PM

Pour travailler sur le téléchargement de fichiers, nous allons utiliser l'assistant de formulaire. Voici un exemple de téléchargement de fichiers.

Routage CakePHP Routage CakePHP Sep 10, 2024 pm 05:25 PM

Dans ce chapitre, nous allons apprendre les sujets suivants liés au routage ?

Discuter de CakePHP Discuter de CakePHP Sep 10, 2024 pm 05:28 PM

CakePHP est un framework open source pour PHP. Il vise à faciliter grandement le développement, le déploiement et la maintenance d'applications. CakePHP est basé sur une architecture de type MVC à la fois puissante et facile à appréhender. Modèles, vues et contrôleurs gu

CakePHP créant des validateurs CakePHP créant des validateurs Sep 10, 2024 pm 05:26 PM

Le validateur peut être créé en ajoutant les deux lignes suivantes dans le contrôleur.

See all articles