Ubuntu 7.10 comes with 5.2.3. However the changes required are quite minor.
Note: all the following steps need to be done as root.
First make sure both php5 and php5-dev packages are installed.
Next go to /usr/lib/php5/build/ and replace the acinclude.m4 file with the one here:
(This is to get the [PHP_SETUP_ICU] macro, which was added in php 5.2.4)
Next, go to /usr/include/php5/main/ and open php_config.h and at the end add this line:
#define HAVE_PTRDIFF_T 1
Now you should be ready to do the install, which is as simple as:
pecl install intl
It will download a 150K file, and compile and install it.
At the end it says to add a line to php.ini. Assuming you want the intl extension in both the apache module and the cli version of php, then go to /etc/php5/conf.d/ and create a file called intl.ini and in that file put this single line:
A quick way to check it all worked is to type:
php -i | grep intl
If it didn't work you will see nothing. If it worked you'll see a line talking about "intl.default_locale".