CentOS uses yum to install php performance testing tool xhprof

Source: Internet
Author: User
CentOS uses yum to install the php performance testing tool xhprof 1. first install xhprof:

yum install xhprof


2. after installation, find the xhprof configuration file xhprof. conf, which will be added to/etc/php. d:

extension=xhprof.soxhprof.output_dir=
 

This path refers to the folder where the generated data is stored, for example,/var/www/html/xhprof_data.


3. to create a graph, install dot (optional ):

yum install graphviz


4. restart the server after installation:

service httpd restart


5. you only need to include the following file code:

# In the php header, you can set the record frequency, for example, record one thousandth xhprof_enable (XHPROF_FLAGS_CPU + XHPROF_FLAGS_MEMORY );
# Add if ($ xhprof_flag) {$ xhprof_data = xhprof_disable (); include_once ". /xhprof_lib/utils/xhprof_lib.php "; include_once ". /xhprof_lib/utils/xhprof_runs.php "; $ xhprof_runs = new XHProfRuns_Default (); $ xhprof_runs-> save_run ($ xhprof_data, 'xhprof'," index _". time ());}

The above two files, xhprof_lib, php, and xhprof_runs.php, must be changed to their own paths. do not make any mistakes. if you cannot find these two files, you can run the whereis xhprof command to list all paths related to xhprof. you can query them one by one .?


6. copy the xhprof_html folder to the root directory of your web server to access the generated files. when you access this php Directory to generate a record file similar to index_1277956324.xhprof, using a http://www.url.com/xhprof_html/index.php like? Run = index_1277956324. The result is displayed. You can also use the http://www.url.com/xhprof_html/index.php] file directory, and then select any one of them.

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.