Friday, 4 June 2010

Installing PHP 5.3 on CentOS 5

Using the 3rd party repository by Remi Collet, which seems to be the most popular 3rd party web repo.

1) Install the repo by following the instructions on his website: http://blog.famillecollet.com/pages/Config (this site is in French, which can be automatically translated if you use Google Chrome!). Note that it depends on the EPEL repo, but the instructions take care of that as well. For me, this meant executing the following commands:
wget http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarch.rpm
wget http://rpms.famillecollet.com/enterprise/remi-release-5.rpm
sudo rpm-Uvh remi-release-5 *. rpm EPEL-release-5 *. rpm

2) Enable the new repository by setting enabled=1 in this file: /etc/yum.repos.d/remi.repo

3) Upgrade your PHP packages. Optionally you can add the suffix mysql-* to upgrade your mysql packages as well. Note: this will automagically fetch the GPG key for Remi's repo.
sudo yum update php php-*

4) Restart Apache
sudo /etc/init.d/httpd restart

Note: after this I got an error on all pages: "Warning: strtotime(): It is not safe to rely on the system's timezone settings". The solution was to add my timezone to /etc/php.ini i.e. add the line
date.timezone = "Europe/London"
You can find a list of supported timezones here: http://www.php.net/manual/en/timezones.php


References
http://gofedora.com/how-to-install-php-on-centos-red-hat-rhel/

Wednesday, 2 June 2010

Installing GIMP 2.7 on Ubuntu 9.10 Karmic

I wanted to try the latest version of GIMP, to see the long sought after single-window mode in action.

Method 1 - PPA

The first, and by far the easiest method is by using the PPA on this page: https://launchpad.net/~matthaeus123/+archive/mrw-gimp-svn

You simply add the repo with this command: 
sudo add-apt-repository ppa:matthaeus123/mrw-gimp-svn
and then add the GPG key:
sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 405A15CB

PROBLEM HTTP fetch error 7: couldn't connect to host
SOLUTION Open up the outbound TCP port 11371

Then you can install gimp using apt-get (or simply run an update if you already had it installed).


Method 2 - From source

The second method is to install it from source, and while this is much more of a challenge, it doesn't rely on any third party PPAs...

PREPERATION
3 commands to modify (change /home/jack to your home dir), and execute:
mkdir /home/jack/programs/gimp-2.7
export PKG_CONFIG_PATH=/home/jack/programs/gimp-2.7/lib/pkgconfig/:$PKG_CONFIG_PATH
export LD_LIBRARY_PATH=/home/jack/programs/gimp-2.7/lib:$LD_LIBRARY_PATH

INSTRUCTIONS
Download gimp-2.7.0.tar.bz2 from http://www.gimp.org/, and extract it and run the installation commands:
./configure --prefix=/home/jack/programs/gimp-2.7
make
sudo make install
But of course I encountered loads of problems during the configuration stage:

PROBLEM configure: error: Your intltool is too old. You need intltool 0.40.1 or later.
SOLUTION sudo apt-get install intltool

PROBLEM No package 'babl' found
SOLUTION Found http://developer.gimp.org/git.html which has lots of the tools you will probably need including babl and gegl. Eventually found my way to ftp://ftp.gtk.org/pub/babl and downloaded the latest version of babl (for me, this was 0.1/babl-0.1.2.tar.bz2). Extract it, and do the following installation commands:
./automake.sh --prefix=/home/jack/programs/gimp-2.7
make
sudo make install
BUT I encountered more problems along the way:

PROBLEM Got an error message saying I needed ruby
SOLUTION sudo apt-get install ruby1.8-dev

I think at this point babl successfully installed. Back to trying to ./configure gimp, and now we get the following problem:

PROBLEM No package 'gegl' found
SOLUTION Similar to babl, we go to ftp://ftp.gtk.org/pub/gegl and download the latest version, extract it and try to install it with:
./automake.sh --prefix=/home/jack/programs/gimp-2.7
make
sudo make install
But of course we encounter lots of problems:

PROBLEM You must have glib-gettextize installed to compile GEGL
SOLUTION sudo apt-get install libglib2.0-dev

PROBLEM Loads of errors about GDK and GTK, the first of which was:
gegl-paint.c:22:21: error: gtk/gtk.h: No such file or directory
SOLUTION (Note: this auto-installed LOADS of dependencies for me):
sudo aptitude install libgtk2.0-dev
May also need to execute this next command, but not sure (BEWARE: BIG DOWNLOAD!)
sudo apt-get install asciidoc

Then I was back on track for the main GIMP installation, so tried to run the configure script again (remember the --prefix)...

PROBLEM Checks for TIFF libary failed
SOLUTION sudo apt-get install libtiff4-dev

PROBLEM Could not find Python headers
SOLUTION sudo apt-get install python2.6-dev

PROBLEM Could not find PyGTK 2.10.4 or newer
SOLUTION sudo apt-get install python-gtk2-dev

And then I was able to complete the install!!!! You can then run it using /home/jack/programs/gimp-2.7/bin/gimp-2.7