Tag Archives: Ubuntu

Installing PHP 5.3.x in Ubuntu through apt-get or aptitude

Recently, I wanted to play around with some stuff which is available only in PHP 5.3.x (more about it later in a separate blog post) and so was looking for a way to install it on my Ubuntu server, where this blog is running.

After poking around a bit, I found that Karmic Ubuntu hasn’t upgraded to PHP 5.3.x yet and the only way to do is to compile from PHP source. Even though I am pretty comfortable doing it, I didn’t wanted to do it, because it is very difficult to upgrade at a later point in time.

I was continuing my research and then found that it is in fact possible to install PHP 5.3.x though apt-get or aptitude. I thought of documenting it here, so that it would be useful for others who want to do the same thing.

Adding dotdeb to the source list

First you should add dotdeb repository to your apt-get source list. Add the following two lines to your /etc/apt-get/sources.list file

sudo vim /etc./apt-get/sources.list

Adding dotdeb keys to keyring

Dotdeb packages are GPGsigned. Issue the following commands to add the keys to key-ring

Install PHP5 packages

Then issue the following command to retrieve the updated package list. I am using aptitude here; you can use apt-get as well.

sudo aptitude update

sudo aptitude upgrade

And then you can install PHP5 packages (and modules) using the normal install command.

sudo aptitude install php5 libapache2-mod-php5

Installing php5-dev package

The above method will install all php5-* packages, but php5-dev has some dependency issues with libtool packages. In order to solve that you have to manually install libtool v1.5.26. To do that use the following commands.

Now it’s time to enjoy the new features that are available in PHP5.3 🙂

Posted in Unix/Server Stuff, Web Programming | Tagged , | 17 Comments

Changing the default config editor in Ubuntu

If you are following the articles at Slicehost, then you may notice that PickledOnion uses nano as the default editor. I somehow like vi more than nano (not ready for a debate 😉 ) and was looking for a way to make vi the default config editor. After some googling, I found how to do it.

I am writing it down here so that all I have to remember is that I just need to search my blog if I need to do it again in future.

Okay the command you have to use is (I am assuming that you are not logged in as root, which is the recommended approach)

sudo update-alternatives --config editor

And then press the number corresponding to the editor which you want to use. Below is the screenshot of how it looked in my slice.

Changing default config editor in Ubuntu

Posted in Unix/Server Stuff | Tagged , , , , , | 2 Comments