Skip to content

Instantly share code, notes, and snippets.

@reagent
Last active October 30, 2019 16:35
Show Gist options
  • Save reagent/c9a1bd3bb9a3bf7bf024 to your computer and use it in GitHub Desktop.
Save reagent/c9a1bd3bb9a3bf7bf024 to your computer and use it in GitHub Desktop.
Downgrade Apache + PHP on Ubuntu 14.04
cat <<EOF >> /etc/apt/sources.list
deb http://archive.ubuntu.com/ubuntu precise main restricted universe
deb http://archive.ubuntu.com/ubuntu precise-updates main restricted universe
deb http://security.ubuntu.com/ubuntu precise-security main restricted universe multiverse
EOF
apt-get update
apt-get purge \
apache2 \
apache2-bin \
apache2-data \
apache2-mpm-prefork \
libapache2-mod-php5 \
dh-php5 \
php-pear \
php5 \
php5-cgi \
php5-cli \
php5-common \
php5-curl \
php5-dev \
php5-gd \
php5-json \
php5-mcrypt \
php5-mysql \
php5-readline \
pkg-php-tools
apt-get install \
apache2-mpm-prefork=2.2.22-1ubuntu1.10 \
apache2-prefork-dev=2.2.22-1ubuntu1.10 \
apache2.2-bin=2.2.22-1ubuntu1.10 \
apache2.2-common=2.2.22-1ubuntu1.10 \
apache2-utils=2.2.22-1ubuntu1.10 \
libapache2-mod-php5=5.3.10-1ubuntu3.19 \
php5-common=5.3.10-1ubuntu3.19 \
php5-cli=5.3.10-1ubuntu3.19 \
php5-curl=5.3.10-1ubuntu3.19 \
php5-dev=5.3.10-1ubuntu3.19 \
php5-gd=5.3.10-1ubuntu3.19 \
php5-mcrypt=5.3.5-0ubuntu1 \
php5-mysql=5.3.10-1ubuntu3.19
a2enmod rewrite
a2ensite nea-production.conf
a2dissite 000-default
service apache2 restart
@1v
Copy link

1v commented Sep 13, 2015

Thanks. But for one who use this: better purge change to remove.

@jcowley
Copy link

jcowley commented Feb 16, 2017

Thanks for this.

The current version of the script no longer works because the package versions of Apache 2.2.22 and PHP 5.3.10 are no longer available. Here are the changes required to bring it back up to date: View the diff here

Updated version: https://gist.github.com/jcowley/15909a25098fc692aeb821b4f12e4265

@kuttumiah
Copy link

Thanks for the script.

Update script to work on Ubuntu 18.04 LTS.
it was specially modified to work on an AWS EC2 instance

Updated version: https://gist.github.com/kuttumiah/eec9726ee77fbe12cd5d38762a3a0ac0

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