Difference between revisions of "Setting up xhprof on Moodle"

Jump to: navigation, search
(Created page with "The following instructions are for setting up xhprof for Moodle under a Ubuntu/Debian environment. The process should be similar for other linux enviroments, but will need some t...")
 
Line 1: Line 1:
 
The following instructions are for setting up xhprof for Moodle under a Ubuntu/Debian environment. The process should be similar for other linux enviroments, but will need some tweaking if you wish to do this under windows. Please update this document if you find any major problems.
 
The following instructions are for setting up xhprof for Moodle under a Ubuntu/Debian environment. The process should be similar for other linux enviroments, but will need some tweaking if you wish to do this under windows. Please update this document if you find any major problems.
 +
 +
==Installing xhprof==
  
 
<code bash>
 
<code bash>
Line 20: Line 22:
 
xhprof.output_dir="/var/tmp/xhprof"
 
xhprof.output_dir="/var/tmp/xhprof"
 
</code>
 
</code>
 +
 +
Restart Apache
 +
<code bash>
 +
sudo service apache2 retart
 +
</code>
 +
 +
Create a file in your web root that makes a call to phpinfo(); and then view the result in your browser to make sure that xhprof is enabled in PHP. Checking the output of '''php -m''' would also work if you are sure that the command line version of PHP uses the same php.ini file as your web server.
 +
 +
==Configuring Moodle to use xhprof==

Revision as of 10:11, 27 February 2012

The following instructions are for setting up xhprof for Moodle under a Ubuntu/Debian environment. The process should be similar for other linux enviroments, but will need some tweaking if you wish to do this under windows. Please update this document if you find any major problems.

Installing xhprof

mkdir ~/src/
cd ~/src/
wget http://pecl.php.net/get/xhprof-0.9.2.tgz
tar xvf xhprof-0.9.2.tgz
cd xhprof-0.9.2/extension/
phpize
./configure
make
sudo make install

Add the following to the apache version of you php.ini file

[xhprof]
extension=xhprof.so
xhprof.output_dir="/var/tmp/xhprof"

Restart Apache

sudo service apache2 retart

Create a file in your web root that makes a call to phpinfo(); and then view the result in your browser to make sure that xhprof is enabled in PHP. Checking the output of php -m would also work if you are sure that the command line version of PHP uses the same php.ini file as your web server.

Configuring Moodle to use xhprof