Created
November 29, 2013 13:31
-
-
Save sachitsac/7705722 to your computer and use it in GitHub Desktop.
Install Xhprof on ubuntu 12.04 and enable the web interface using an alias /profiling
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
sudo apt-get install php-pear | |
sudo pear upgrade pear | |
sudo pecl install xhprof-beta | |
sudo apt-get install graphviz | |
sudo cp /etc/php5/apache2/php.ini /etc/php5/apache2/php.ini_original | |
sudo cp /etc/php5/apache2/php.ini /tmp | |
echo "#Enable XHPROF Extension" >> /tmp/php.ini | |
echo "extension=xhprof.so" >> /tmp/php.ini | |
sudo chown $USER /tmp/php.ini | |
sudo chmod 775 /tmp/php.ini | |
sudo cp /tmp/php.ini /etc/php5/apache2/ | |
sudo service apache2 restart | |
# Add xhprof to apache | |
touch /tmp/profiling | |
echo "Alias /profiling /usr/share/php/xhprof_html" >> /tmp/profiling | |
echo "<Directory /usr/share/php/xhprof_html/>" >> /tmp/profiling | |
echo "Options +Indexes +FollowSymLinks" >> /tmp/profiling | |
echo "AllowOverride None" >> /tmp/profiling | |
echo "order allow,deny" >> /tmp/profiling | |
echo "allow from all" >> /tmp/profiling | |
echo "</Directory>" >> /tmp/profiling | |
sudo mv /tmp/profiling /etc/apache2/sites-available/ | |
sudo a2ensite profiling | |
sudo service apache2 restart |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment