INSTALL.txt 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. Install XHProf
  2. --------------
  3. To install XHProf, use the following commands as described on http://techportal.inviqa.com/2009/12/01/profiling-with-xhprof/:
  4. apt-get install php5-common
  5. pecl config-set preferred_state beta
  6. pecl install xhprof
  7. If it complains because it can't find config.m4, you can still build the extension manually, using the following steps:
  8. wget http://pecl.php.net/get/xhprof-0.9.2.tgz
  9. tar xvf xhprof-0.9.2.tgz
  10. cd ./xhprof-0.9.2/extension/
  11. phpize
  12. ./configure --with-php-config=/usr/local/bin/php-config
  13. make
  14. make install
  15. make test
  16. In the ./configure line above, if you use Ubuntu, it is likely you php-config
  17. will have to be declared as /usr/bin/php-config. Check it with
  18. "which php-config".
  19. Once you have XHProf installed, you should enable it. Open your php.ini or
  20. /etc/php5/conf.d/xhprof.ini and type:
  21. [xhprof]
  22. extension=xhprof.so
  23. xhprof.output_dir="/tmp"
  24. If you use PHP 5.4, you will need to download xhprof from Git:
  25. git clone git://github.com/facebook/xhprof.git
  26. and sudo, make, make install
  27. Combine with Chamilo
  28. --------------------
  29. To enable XHProf on your Chamilo, add this to your VirtualHost configuration
  30. (assuming your Chamilo install is as /var/www/chamilo):
  31. php_value auto_prepend_file /var/www/chamilo/tests/xhprof/header.php
  32. php_value auto_append_file /var/www/chamilo/tests/xhprof/footer.php
  33. Also check /var/www/chamilo/tests/xhprof/footer.php to update the sprintf
  34. command to use the name of your host.