views:

332

answers:

2

I know with python and a couple other languages there is a way to safely make install a newer generational version of a language onto a machine, but after digging through PHP5's configure & makefile the only thing I've seen is the prefix dir option and the ini scan path.

Ideally I'd like php5 to have its own lib/bin subdirectories in /usr/local and then I can just put php5 after php4 in the path or make a symbolic link from the php5 binaries to php5-cli, php5-cgi, etc.

Also, am I missing anything dramatically bad here, the server in question is a legacy application server that's still somewhat busy and is due to be deprecated by June of 2009 but in the meantime the plan is to start updating parts with php5 code.

Machine states: CENTOS 5 PHP 4 was built from a source RPM outside of yum's control

Most of php4 is in ambiguous directories: /usr/{include,lib}/php

+1  A: 

The cli version should be easy

configure --prefix=/usr/local/php5
make install-cli

It's not possible to run PHP4 and PHP5 as module together in one Apache server. But is possible to run php version X as module and version Y as cgi. Its also possible to run both as cgi.

I found these walkthroughs:

  1. Setting up PHP5 in parallel with PHP4
  2. Configure Apache to work with PHP4 and PHP5
  3. More google results
Bob Fanger
Actually it is possible to run both as modules on Apache, I'll have to dig up the recipe I wrote 2-3 years ago on how to do it but the trick was to set the handler per vhost. It worked pretty much flawless.
David
The only solutions I can find are phpX as module and phpY as cgi or both as cgi.
Bob Fanger
Last time I tried to install PHP5 parallel to PHP4, it killed the PEAR installation. :-(
stesch
+2  A: 

Here's a pretty detailed explanation on how to do this on Gentoo with some tips to watch out for.

link text

And here's another one for good measure

link text

Ólafur Waage