Skip to content

Instantly share code, notes, and snippets.

@avandrevitor
Forked from psaraiva/Xhprof
Created February 16, 2017 01:27
Show Gist options
  • Save avandrevitor/7134f775d402d0e16928b19e33ae5690 to your computer and use it in GitHub Desktop.
Save avandrevitor/7134f775d402d0e16928b19e33ae5690 to your computer and use it in GitHub Desktop.
Usando o xhprof.
Pegar a pasta xhprof e jogar em /var/www
1. Install dependencies
# aptitude 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
Alterar o virtual host do projeto conforme exemplo
<VirtualHost *:80>
DocumentRoot "/var/www/meuprojeto.local/public"
ServerName blablabla.local
# This should be omitted in the production environment
#SetEnv APPLICATION_ENV development
SetEnv APPLICATION_ENV "testing"
<Directory "/var/www/meuprojeto.local/public">
DirectoryIndex index.php
Options Indexes MultiViews FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
php_value auto_prepend_file "/var/www/xhprof/scripts/ini.php"
php_value auto_append_file "/var/www/xhprof/scripts/end.php"
</Directory>
#ErrorLog ${APACHE_LOG_DIR}/meuprojeto/error.log
</VirtualHost>
reiniciar o apache
# service apache2 restart
"Isso é tudo pe... pe... pe... pessoal"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment