Skip to content

Instantly share code, notes, and snippets.

@ifnull
Created July 8, 2014 19:16
Show Gist options
  • Save ifnull/7544d3e52594654c9a08 to your computer and use it in GitHub Desktop.
Save ifnull/7544d3e52594654c9a08 to your computer and use it in GitHub Desktop.
Install xdebug and Webgrind for debugging Magento performance problems.

Install xdebug and Webgrind

sudo su -
pecl install xdebug
apt-get install unzip
curl -o /tmp/webgrind-release-1.0.zip https://webgrind.googlecode.com/files/webgrind-release-1.0.zip
unzip /tmp/webgrind-release-1.0.zip -d /srv/app/store/
chown -R vagrant:vagrant /srv/app/store/
  • Unzipping to the Magento store directory because it is already setup to serve PHP.
  • DO NOT commit Webgrind

Enable xdebug in PHP

cat <<EOT >> /etc/php5/fpm/conf.d/xdebug.ini
zend_extension="/usr/lib/php5/20090626/xdebug.so"
zend_extension_ts="/usr/lib/php5/20090626/xdebug.so"
xdebug.profiler_enable = 1
EOT

Reload

service php5-fpm restart
service apache2 restart

Profit

http://127.0.0.1:8001/webgrind/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment