Skip to content

Instantly share code, notes, and snippets.

@enoch85
Created October 15, 2015 23:04
Show Gist options
  • Save enoch85/2367c396a2e119a12894 to your computer and use it in GitHub Desktop.
Save enoch85/2367c396a2e119a12894 to your computer and use it in GitHub Desktop.
#!/bin/bash
#
# Tech and Me 2015 - https://www.en0ch.se
#
# This requires PHP 5.5
# Must be root
[[ `id -u` -eq 0 ]] || { echo "Must be root to run script, in Ubuntu type: sudo -i"; exit 1; }
# Print current version
echo
echo Current apcu version is
sudo dpkg -s php5-apcu |grep Version:
sleep 5
echo
# Remove old version
sudo php5dismod apcu
sudo apt-get purge php5-apcu -y
# Install APCu 4.0.6
sudo apt-get update
wget https://launchpad.net/~ondrej/+archive/ubuntu/php5/+build/6149263/+files/php5-apcu_4.0.6-1%2Bdeb.sury.org~utopic%2B1_amd64.deb
sudo dpkg -i php5-apcu_4.0.6-1+deb.sury.org~utopic+1_amd64.deb
sudo php5enmod apcu
rm php5-apcu_4.0.6-1+deb.sury.org~utopic+1_amd64.deb
# Final configuration
sudo rm /etc/php5/mods-available/apcu-cli.ini
sudo touch /etc/php5/mods-available/apcu-cli.ini
sudo echo 'apc.enable_cli = 1' > /etc/php5/mods-available/apcu-cli.ini
sudo php5enmod apcu-cli
sudo service apache2 restart
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment