Downgrade php version from 5.3 to 5.2 on Ubuntu 10.04 i386

I have chance to install new server with standard requirement. SSH, Bind9 and LAMP.

All process is smooth using i386 version of Ubuntu 10.04 but my friend complain about his web application not work well and after little investigation it looks like due to PHP version.

Quick search on Google lead me to RandyFay post about downgrade PHP version to 5.2 on Ubuntu 10.04

I follow the method and rewrite it with a few things that might useful for newbie like me 🙂

Note :

I use ubuntu 10.04 i386 and username : alam

Let start

Download required files for PHP 5.2 from Ubuntu Karmic repository

# wget http://randyfay.com/sites/default/files/karmic_0.list

# mv /home/pusda/karmic_0.list /etc/apt/sources.list.d

# wget http://randyfay.com/sites/default/files/php_1.

# mv /home/pusda/php_1. /etc/apt/preferences.d/php

Find out installed PHP version

# dpkg –get-selections | grep php

libapache2-mod-php5                             install
php-db                                          install
php-pear                                        install
php5                                            install
php5-cli                                        install
php5-common                                     install
php5-gd                                         install
php5-mcrypt                                     deinstall
php5-mysql                                      install

Delete those PHP with apt-get remove

# apt-get remove libapache2-mod-php5 php-db php-pear php5 php5-cli php5-common php5-gd php5-mcrypt php5-mysql

# apt-get autoremove

Update repository and reinstall PHP

#apt-get update

#apt-get install php5 libapache2-mod-php5 php-db php5-cli php5-common php5-xsl php5-gd php-pear php5-mysql php5-curl php5-memcache

Check PHP version

# php -v

PHP Warning:  PHP Startup: Unable to load dynamic library ‘/usr/lib/php5/20060613+lfs/mcrypt.so’ – /usr/lib/php5/20060613+lfs/mcrypt.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP 5.2.10-2ubuntu6 with Suhosin-Patch 0.9.7 (cli) (built: Oct 23 2009 16:30:10)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies
#

Dealing with php5-mcrypt error

# apt-get install php5-mcrypt

Reading package lists… Done
Building dependency tree
Reading state information… Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
php5-mcrypt: Depends: phpapi-20090626+lfs
E: Broken packages
#

Quick solution for php5-mcrypt installation error

# nano /etc/apt/preferences.d/php

put these lines :

Package: php5-mcrypt
Pin: release a=karmic
Pin-Priority: 991

at the bottom.

Try reinstall php5-mcrypt

# apt-get install php5-mcrypt

Reading package lists… Done
Building dependency tree
Reading state information… Done
The following extra packages will be installed:
libmcrypt4
Suggested packages:
libmcrypt-dev mcrypt
The following NEW packages will be installed:
libmcrypt4 php5-mcrypt
0 upgraded, 2 newly installed, 0 to remove and 4 not upgraded.
Need to get 91.4kB of archives.
After this operation, 332kB of additional disk space will be used.
Do you want to continue [Y/n]?y

Recheck php version after install php5-mcrypt

# php -v

PHP 5.2.10-2ubuntu6 with Suhosin-Patch 0.9.7 (cli) (built: Oct 23 2009 16:30:10)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies
#

Great.

PHP successfully downgrade to 5.2.10

How to install MariaDB on CentOS 5.5

First thing I want to try on CentOS 5.5 is mariadb. Fortunately mariadb available in binary for CentOS and don’t force me to install from source like I do with FreeBSD since its not available yet on FreeBSD ports.

I’m going to install mariadb 5.23 and make it as learning media 🙂

Here the steps :

Download mariadb rpm file

Get all rpm file (client and server) from osuosl mirror.

# ls

MariaDB-client-5.2.3-87.el5.i386.rpm  MariaDB-server-5.2.3-87.el5.i386.rpm

Install the files

# rpm -i MariaDB-*

error: Failed dependencies:
libmysqlclient.so.16 is needed by MariaDB-client-5.2.3-87.el5.i386
libmysqlclient.so.16(libmysqlclient_16) is needed by MariaDB-client-5.2.3-87.el5.i386
libmysqlclient_r.so.16 is needed by MariaDB-client-5.2.3-87.el5.i386
libmysqlclient_r.so.16(libmysqlclient_16) is needed by MariaDB-client-5.2.3-87.el5.i386
libmysqlclient.so.16 is needed by MariaDB-server-5.2.3-87.el5.i386
libmysqlclient.so.16(libmysqlclient_16) is needed by MariaDB-server-5.2.3-87.el5.i386
libmysqlclient_r.so.16 is needed by MariaDB-server-5.2.3-87.el5.i386
libmysqlclient_r.so.16(libmysqlclient_16) is needed by MariaDB-server-5.2.3-87.el5.i386
#

Continue reading

Step by step guide install CentOS 5.5 with network install

New class has started and I try to give my student new experince. During my search I found new thing that I think they like to try. Network installation would be good for next lesson. I ever try it few years ago with Linux Mandrake. Create diskette boot and perform installation from network server where all required files has already copied.

Nowadays, its rare to see computer with floppy disk as slowly replaced by usb flash disk. Ok, I decide to try install CentOS 5.5 with network install mode.

Here the steps :

Download CentOS 5.5  iso file

Get from nearest mirror by visit this link.

Pick one mirror and you should see the list.

Continue reading

How to upgrade mariadb 5.1.50 to mariadb 5.2.3

New mariadb 5.2.3 version already out. I just curious on how to upgrade mariadb since I just installed it 3 days ago 🙂

From montyprogram :

MariaDB 5.2.3 is a Stable release. In general this means there are no known serious bugs and we believe the code is ready for general usage.

Here’s upgrade process of mariadb from 5.1.50 to 5.2.3 on freebsd 8.1 stable :

Backup first

#cd /usr/local

#tar cvzf var.tar.gz var

#mv var.tar.gz /home/alamsyah

Continue reading

How to install mariadb on FreeBSD

Recent discussion around mysql license and its future lead me to mariadb.

From Wikipedia

MariaDB is a community-developed branch of the MySQL database, the impetus being the community maintenance of its free status under GPL, as opposed to any uncertainty of MySQL license status under its current ownership by Oracle.

The intent also being to maintain high fidelity with MySQL, ensuring a “drop-in” replacement capability with library binary equivalency and exacting matching with MySQL APIs and commands. It includes the XtraDB storage engine as a replacement for InnoDB.

Its lead developer is Monty Widenius, the founder of MySQL and Monty Program AB.”

dba by night, ninja by nightBeing curious I decide to install mariadb on my Freebsd 8.1 stable . My first option for install is via ports but at time writing I don’t find the mariadb port 🙁

After search and dig google I came up with solution on how to install mariadb from source.

Here the steps :

Continue reading