Downngrade PHP 5.4 ke PHP 5.3 di ubuntu 12.10


sebenarnya udah beberapa hari kemaren aku ingin memposting bagaimana cara kita membuat portal berita seperti detik, atau jpnn, atau republika, dan lain sebagainya. tapi sayang saat saya menginstall openpublish yang merupakan salah satu drupal distribution yang memang dikembangkan untuk portal berita di browser menampilkan pesan error sampai puluhan kali.
untuk kebutuhan tersebut awalnya saya menggunakan openpublish beta 7, namun berhubung berkali kali saya oprek file php5.ini dan juga httpd.conf masih menunjukkan hal yang sama akhirnya saya ambil yang versi stable openpublish 2.3 namun sayang walaupun menampilkan error tidak seperti yang versi beta tapi menurut saya masih terlalu mengganggu.

akhirnya setelah searching tanpa ada penyelesaian yang jelas malah sebagian besar diforum berkomentar semua baik baik saja saat menginstall openpublish 2.3 atau yang mengupdate ke versi 2.3 akhirnya saya ambil keputusan untuk mendowngrade versi php dilaptop yang saya gunakan.

script untuk mendowngrade php 5.4 ke php 5.3 di ubuntu 12.10
#!/bin/bash
# 
# Original for 5.3 by Ruben Barkow (rubo77) http://www.entikey.z11.de/
# release 1 PHP5.4 to 5.3 by Emil Terziev ( foxy ) Bulgaria

# Originally Posted by Bachstelze http://ubuntuforums.org/showthread.php?p=9080474#post9080474
# OK, here's how to do the Apt magic to get PHP packages from the precise repositories:

echo "Am I root?  "
if [ "$(whoami &2>/dev/null)" != "root" ] && [ "$(id -un &2>/dev/null)" != "root" ] ; then
  echo "  NO!

Error: You must be root to run this script.
Enter
sudo su
"
  exit 1
fi
echo "  OK";


#install aptitude before, if you don`t have it:
apt-get update
apt-get install aptitude
# or if you prefer apt-get use:
# alias aptitude='apt-get'

# finish all apt-problems:
aptitude update
aptitude -f install
#apt-get -f install


# remove all your existing PHP packages. You can list them with dpkg -l| grep php
PHPLIST=$(for i in $(dpkg -l | grep php|awk '{ print $2 }' ); do echo $i; done)
echo these pachets will be removed: $PHPLIST 
# you need not to purge, if you have upgraded from precise:
aptitude remove $PHPLIST
# on a fresh install, you need purge:
# aptitude remove --purge $PHPLIST


#Create a file each in /etc/apt/preferences.d like this (call it for example /etc/apt/preferences.d/php5_2);
#
#Package: php5
#Pin: release a=precise
#Pin-Priority: 991
#
#The big problem is that wildcards don't work, so you will need one such stanza for each PHP package you want to pull from precise:

echo ''>/etc/apt/preferences.d/php5_3
for i in $PHPLIST ; do echo "Package: $i
Pin: release a=precise
Pin-Priority: 991
">>/etc/apt/preferences.d/php5_3; done

echo "# needed sources vor php5.3:
deb http://bg.archive.ubuntu.com/ubuntu/ precise main restricted
deb-src http://bg.archive.ubuntu.com/ubuntu/ precise main restricted

deb http://bg.archive.ubuntu.com/ubuntu/ precise-updates main restricted
deb-src http://bg.archive.ubuntu.com/ubuntu/ precise-updates main restricted

deb http://bg.archive.ubuntu.com/ubuntu/ precise universe
deb-src http://bg.archive.ubuntu.com/ubuntu/ precise universe
deb http://bg.archive.ubuntu.com/ubuntu/ precise-updates universe
deb-src http://bg.archive.ubuntu.com/ubuntu/ precise-updates universe

deb http://bg.archive.ubuntu.com/ubuntu/ precise multiverse
deb-src http://bg.archive.ubuntu.com/ubuntu/ precise multiverse
deb http://bg.archive.ubuntu.com/ubuntu/ precise-updates multiverse
deb-src http://bg.archive.ubuntu.com/ubuntu/ precise-updates multiverse
deb-src http://bg.archive.ubuntu.com/ubuntu/ natty-backports main restricted universe multiverse

deb http://security.ubuntu.com/ubuntu precise-security main restricted
deb-src http://security.ubuntu.com/ubuntu precise-security main restricted
deb http://security.ubuntu.com/ubuntu precise-security universe
deb-src http://security.ubuntu.com/ubuntu precise-security universe
deb http://security.ubuntu.com/ubuntu precise-security multiverse
deb-src http://security.ubuntu.com/ubuntu precise-security multiverse

deb-src http://archive.canonical.com/ubuntu natty partner

deb http://extras.ubuntu.com/ubuntu precise main
deb-src http://extras.ubuntu.com/ubuntu precise main

deb http://bg.archive.ubuntu.com/ubuntu/ precise-backports main restricted universe multiverse
deb-src http://bg.archive.ubuntu.com/ubuntu/ precise-backports main restricted universe multiverse


deb http://archive.canonical.com/ubuntu precise partner
deb-src http://archive.canonical.com/ubuntu precise partner

" >> /etc/apt/sources.list.d/precise.list

aptitude update

apache2ctl restart

echo install new from precise:
aptitude -t precise install $PHPLIST

# at the end retry the modul libapache2-mod-php5 in case it didn't work the first time:
aptitude -t precise install libapache2-mod-php5

apache2ctl restart

cara penggunaan copy script diatas ke editor kesayangan anda kalau saya biasa menggunakan gedit bawaan dari ubuntu, setelah itu simpan dengan nama downgrade_php.sh dihome direktory.
dari terminal jalankan perintah ini
chmod o+x /home/kevin/downgrade_php.sh
sudo /home/kevin/downgrade_php.sh
setelah itu cek dengan perintah
php -v

Share this post :

Posting Komentar

 
Support : Creating Website | Johny Template | Mas Template
Copyright © 2011. Kevin Kurnia - All Rights Reserved
Template Created by Creating Website Published by Mas Template
Proudly powered by Blogger