On Fri, 2006-08-11 at 00:29 +1000, David Tulloh wrote:
> Chris W. Parker wrote:
> > Hello,
> > 
> > Generally (well, actually 100%) I just use whatever version of PHP is
> > included with a certain distro (Redhat pre-Fedora, Fedora Core, CentOS).
> > None of the versions I've used have come with PHP5 and I'd really like
> > to get with the times and use PHP5.
> > 
> > I know that Fedora Core 5 offers PHP 5.1.2 but I've heard some negative
> > things about it in general (FC5).
> > 
> > I've never compiled PHP myself so admittedly I'm a bit skeered... Is the
> > recommended path to just go with whatever distro I prefer and then
> > download PHP5 from php.net and install it myself?
> > 
> 
> Virtually all distros should have php5 as an option these days.  Though
> frequently it's named php5 rather than simply php.  Debian, and probably
> several other distributions, only offer it in their testing branch.
> 
> As a general rule I would recomend not installing from source, you can
> seriously damage your system with multiple versions of programs, files
> going in places they shouldn't and running in to dependancy hell.  The
> distributions that I am familiar with provide packages for the php
> extensions so you don't have to recompile to add them.

Ummmm, it's pretty simplistic under linux to have mutliple versions. In
fact I have every almost every version since 4.1.0 installed and easily
activated.

I keep a master /usr/local/php/ directory in which each version is
housed and the currently active version is focused by a soft-link
(I have phpWeb versions also since I compile in different features and
they work under the same principle):

::/usr/local/php> ls -al | grep phpCgi
lrwxrwxrwx  1 root root   12 2006-07-31 14:28 phpCgi -> phpCgi-4.4.2/
drwxrwxr-x 16 root root 4.0K 2004-08-25 22:20 phpCgi-4.1.0/
drwxrwxr-x 16 root root 4.0K 2004-08-25 22:20 phpCgi-4.1.1/
drwxrwxr-x 16 root root 4.0K 2004-08-25 22:20 phpCgi-4.1.2/
drwxrwxr-x 17 root root 4.0K 2004-08-25 22:20 phpCgi-4.2.0/
drwxrwxr-x 15 root root 4.0K 2004-08-25 22:20 phpCgi-4.2.1/
drwxrwxr-x 16 root root 4.0K 2004-08-25 22:20 phpCgi-4.2.2/
drwxr-xr-x 16 root root 4.0K 2004-08-25 22:20 phpCgi-4.2.3/
drwxr-xr-x 18 root root 4.0K 2004-08-25 22:20 phpCgi-4.3.0/
drwxrwxr-x 18 root root 4.0K 2004-08-25 22:20 phpCgi-4.3.1/
drwxr-xr-x 18 root root 4.0K 2005-03-23 00:03 phpCgi-4.3.10/
drwxr-xr-x 18 root root 4.0K 2005-07-16 12:55 phpCgi-4.3.11/
drwxrwxr-x 18 root root 4.0K 2004-08-25 22:20 phpCgi-4.3.2/
drwxrwxr-x 18 root root 4.0K 2004-08-20 19:23 phpCgi-4.3.3/
drwxrwxr-x 18 root root 4.0K 2004-08-20 19:30 phpCgi-4.3.4/
drwxr-xr-x 18 root root 4.0K 2005-06-24 01:41 phpCgi-4.3.5/
drwxr-xr-x 18 root root 4.0K 2004-08-20 19:37 phpCgi-4.3.6/
drwxr-xr-x 18 root root 4.0K 2004-08-20 19:40 phpCgi-4.3.7/
drwxr-xr-x 18 root root 4.0K 2004-08-20 19:43 phpCgi-4.3.8/
drwxr-xr-x 18 root root 4.0K 2005-03-23 00:02 phpCgi-4.3.9/
drwxr-xr-x 18 root root 4.0K 2006-03-13 16:41 phpCgi-4.4.0/
drwxr-xr-x 18 root root 4.0K 2006-08-05 15:03 phpCgi-4.4.2/
lrwxrwxrwx  1 root root   12 2006-07-31 14:29 phpCgi5 -> phpCgi-5.1.1/
drwxr-xr-x 18 root root 4.0K 2004-08-20 19:47 phpCgi-5.0.0/
drwxr-xr-x 18 root root 4.0K 2004-04-07 11:53 phpCgi-5.0.0RC1/
drwxrwxr-x 18 root root 4.0K 2004-10-03 09:47 phpCgi-5.0.1/
drwxr-xr-x 18 root root 4.0K 2005-03-23 00:09 phpCgi-5.0.2/
drwxr-xr-x 18 root root 4.0K 2005-03-23 00:12 phpCgi-5.0.3/
drwxr-xr-x 18 root root 4.0K 2005-11-30 23:08 phpCgi-5.1.1/

Then in my /usr/local/bin/ I link to the phpCgi link...

[EMAIL PROTECTED]:/usr/local/bin> ls -al | grep phpCgi
lrwxrwxrwx  1 root root   43 2006-07-31 16:03 pear
-> /usr/local/php/phpCgi/installation/bin/pear*
lrwxrwxrwx  1 root root   46 2006-07-31 16:03 peardev
-> /usr/local/php/phpCgi/installation/bin/peardev*
lrwxrwxrwx  1 root root   43 2006-07-31 16:03 pecl
-> /usr/local/php/phpCgi/installation/bin/pecl*
lrwxrwxrwx  1 root root   42 2006-07-31 16:03 php
-> /usr/local/php/phpCgi/installation/bin/php*
lrwxrwxrwx  1 root root   49 2006-07-31 16:03 php-config
-> /usr/local/php/phpCgi/installation/bin/php-config*
lrwxrwxrwx  1 root root   45 2006-07-31 16:03 phpize
-> /usr/local/php/phpCgi/installation/bin/phpize*

And the magic happens by using the following magical parameters for the
configure script:

    --prefix=/usr/local/php/${PHP_VERSION_DIR}/installation \
    --exec-prefix=/usr/local/php/${PHP_VERSION_DIR}/installation

This makes it really simple to test code with any given version of PHP
since all I need to do is change the softlink in the /usr/local/php/
directory.

For web testing, I change the link and restart the webserver.

Cheers,
Rob.
-- 
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for       |
| creating re-usable components quickly and easily.          |
`------------------------------------------------------------'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to