jaya28inside
September 3rd, 2010, 02:42 AM
Ok guys!
I made this thread for solving out previous cases, for all common ubuntu users who have already installed their php 5.3.
I assume that you all in these condition:
1) Your Repository is still default
2) You have LAMP already installed
3) You have Internet Access
4) You have root privileges
:p
OK. Let's start!
1) Ensuring that you do have php 5.3.x installed
How to check that we have php installed?
simple. Execute this command;
$> dpkg -l | grep php
You'll get the output pretty similar with this;
ii libapache2-mod-php5 5.3.2-1ubuntu4.2 server-side, HTML-embedded scripting languag
ii php5-common 5.3.2-1ubuntu4.2 Common files for packages built from the php
ii php5-curl 5.3.2-1ubuntu4.2 CURL module for php5
ii php5-gd 5.3.2-1ubuntu4.2 GD module for php5
ii php5-imap 5.3.2-0ubuntu2 IMAP module for php5
ii php5-mysql 5.3.2-1ubuntu4.2 MySQL module for php5
OK. Now it means you are in a OK' condition. Continuing next step.
2) Downgrading Php 5.3 to 5.2
Once you're already sure that you do have php 5.3 installed. Then now,
What you will do now is copy and paste this source code below
save it within a file named downGradeNRemove.sh
Just save it anywhere you wanted.
php_installed=`dpkg -l | grep php| awk '{print $2}' |tr "\n" " "`
# remove all php packge
sudo aptitude purge $php_installed
# use karmic for php pakage
# pin-params: a (archive), c (components), v (version), o (origin) and l (label).
echo -e "Package: php5\nPin: release a=karmic\nPin-Priority: 991\n" | sudo tee /etc/apt/preferences.d/php > /dev/null
apt-cache search php5-|grep php5-|awk '{print "Package:", $1,"\nPin: release a=karmic\nPin-Priority: 991\n"}'|sudo tee -a /etc/apt/preferences.d/php > /dev/null
apt-cache search -n libapache2-mod-php5 |awk '{print "Package:", $1,"\nPin: release a=karmic\nPin-Priority: 991\n"}'| sudo tee -a /etc/apt/preferences.d/php > /dev/null
echo -e "Package: php-pear\nPin: release a=karmic\nPin-Priority: 991\n" | sudo tee -a /etc/apt/preferences.d/php > /dev/null
# add karmic to source list
egrep '(main restricted|universe|multiverse)' /etc/apt/sources.list|grep -v "#"| sed s/lucid/karmic/g | sudo tee /etc/apt/sources.list.d/karmic.list > /dev/null
# update package database (use apt-get if aptitude crash)
sudo apt-get update
# install php
sudo apt-get install $php_installed
# or sudo aptitude install -t karmic php5-cli php5-cgi //for fcgi
# or sudo apt-get install -t karmic libapache2-mod-php5 //for apache module
sudo aptitude hold `dpkg -l | grep php5| awk '{print $2}' |tr "\n" " "`
#done
And now, please use Sudo or any root privilege enabled, and execute this file.
How to execute this file anyway?
Pretty funny.
To execute the file, You just need to change the mode of this file to be executable.
Here is the command;
$> chmod u+rx downGradeNRemove.sh
Then, execute it!
$> ./downGradeNRemove.sh
Ok!
Now, let's ensuring that you do now have php 5.2,
execute the previous command;
$> dpkg -l | grep php
You'll obviously got output saying the php. 5.2. I'm sure.
Ok! done!
Now just restart your apache2 by executing this command
$> /etc/init.d/apache2 restart
Boing! Done.
If you ask me which resource I got?
Here; You may read it along;
From indonesian article;
http://muhammad.zamroni.net/downgrade-php-53x-ke-52x-di-ubuntu-10-04-lucid-lynx.html
From russian article;
http://mrkandy.wordpress.com/2010/04/16/install-php-5-2-x-in-ubuntu-10-04-lucid/
From english article;
http://www.nickveenhof.be/blog/reverting-or-downgrading-php-53-52-ubuntu-lucid-lynx-1004
):P
I made this thread for solving out previous cases, for all common ubuntu users who have already installed their php 5.3.
I assume that you all in these condition:
1) Your Repository is still default
2) You have LAMP already installed
3) You have Internet Access
4) You have root privileges
:p
OK. Let's start!
1) Ensuring that you do have php 5.3.x installed
How to check that we have php installed?
simple. Execute this command;
$> dpkg -l | grep php
You'll get the output pretty similar with this;
ii libapache2-mod-php5 5.3.2-1ubuntu4.2 server-side, HTML-embedded scripting languag
ii php5-common 5.3.2-1ubuntu4.2 Common files for packages built from the php
ii php5-curl 5.3.2-1ubuntu4.2 CURL module for php5
ii php5-gd 5.3.2-1ubuntu4.2 GD module for php5
ii php5-imap 5.3.2-0ubuntu2 IMAP module for php5
ii php5-mysql 5.3.2-1ubuntu4.2 MySQL module for php5
OK. Now it means you are in a OK' condition. Continuing next step.
2) Downgrading Php 5.3 to 5.2
Once you're already sure that you do have php 5.3 installed. Then now,
What you will do now is copy and paste this source code below
save it within a file named downGradeNRemove.sh
Just save it anywhere you wanted.
php_installed=`dpkg -l | grep php| awk '{print $2}' |tr "\n" " "`
# remove all php packge
sudo aptitude purge $php_installed
# use karmic for php pakage
# pin-params: a (archive), c (components), v (version), o (origin) and l (label).
echo -e "Package: php5\nPin: release a=karmic\nPin-Priority: 991\n" | sudo tee /etc/apt/preferences.d/php > /dev/null
apt-cache search php5-|grep php5-|awk '{print "Package:", $1,"\nPin: release a=karmic\nPin-Priority: 991\n"}'|sudo tee -a /etc/apt/preferences.d/php > /dev/null
apt-cache search -n libapache2-mod-php5 |awk '{print "Package:", $1,"\nPin: release a=karmic\nPin-Priority: 991\n"}'| sudo tee -a /etc/apt/preferences.d/php > /dev/null
echo -e "Package: php-pear\nPin: release a=karmic\nPin-Priority: 991\n" | sudo tee -a /etc/apt/preferences.d/php > /dev/null
# add karmic to source list
egrep '(main restricted|universe|multiverse)' /etc/apt/sources.list|grep -v "#"| sed s/lucid/karmic/g | sudo tee /etc/apt/sources.list.d/karmic.list > /dev/null
# update package database (use apt-get if aptitude crash)
sudo apt-get update
# install php
sudo apt-get install $php_installed
# or sudo aptitude install -t karmic php5-cli php5-cgi //for fcgi
# or sudo apt-get install -t karmic libapache2-mod-php5 //for apache module
sudo aptitude hold `dpkg -l | grep php5| awk '{print $2}' |tr "\n" " "`
#done
And now, please use Sudo or any root privilege enabled, and execute this file.
How to execute this file anyway?
Pretty funny.
To execute the file, You just need to change the mode of this file to be executable.
Here is the command;
$> chmod u+rx downGradeNRemove.sh
Then, execute it!
$> ./downGradeNRemove.sh
Ok!
Now, let's ensuring that you do now have php 5.2,
execute the previous command;
$> dpkg -l | grep php
You'll obviously got output saying the php. 5.2. I'm sure.
Ok! done!
Now just restart your apache2 by executing this command
$> /etc/init.d/apache2 restart
Boing! Done.
If you ask me which resource I got?
Here; You may read it along;
From indonesian article;
http://muhammad.zamroni.net/downgrade-php-53x-ke-52x-di-ubuntu-10-04-lucid-lynx.html
From russian article;
http://mrkandy.wordpress.com/2010/04/16/install-php-5-2-x-in-ubuntu-10-04-lucid/
From english article;
http://www.nickveenhof.be/blog/reverting-or-downgrading-php-53-52-ubuntu-lucid-lynx-1004
):P