Skip to Content

develCuy's blog

by Fernando Paredes García


HOWTO Install XHProf in Ubuntu and HOWTO use in Drupal 6.x and 7.x

1. Install dependencies

# apt-get install php5-dev

2. Download xhprof source

$ cd /tmp
$ git clone git://github.com/facebook/xhprof.git

3. Install xhprof PHP extension

$ cd xhprof/extension
$ phpize
$ ./configure
$ make
# make install
# echo "extension=xhprof.so" > /etc/php5/conf.d/xhprof.ini
# echo "xhprof.output_dir=/tmp" >> /etc/php5/conf.d/xhprof.ini
# service apache2 restart

4. Install XHProf module in Drupal

a. Install in Drupal 6.x
# cp -a /tmp/xhprof/xhprof_* /var/www/
$ cd myproject
$ drush dl devel
$ go to admin/settings/devel
$ Enable profiling
$ Set xhprof directory: /var/www
$ Set XHProf URL: http://localhost/xhprof_html

b. Install in Drupal 7.x
$ cd myproject/
$ drush dl XHProf-7.x-1.x-dev
$ drush en -y xhprof
$ go to: admin/config/development/xhprof
$ Enable profiling

Blessings!


Post new comment

The content of this field is kept private and will not be shown publicly.
  • You can use Markdown syntax to format and style the text. Also see Markdown Extra for tables, footnotes, and more.
  • Lines and paragraphs break automatically.
  • Web page addresses and e-mail addresses turn into links automatically.

More information about formatting options

Type the characters you see in this picture. (verify using audio)
Type the characters you see in the picture above; if you can't read them, submit the form and a new image will be generated. Not case sensitive.