David
David

Reputation: 18271

How to make php5 on a machine running php4, without breaking anything

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

Upvotes: 1

Views: 722

Answers (2)

Bob Fanger
Bob Fanger

Reputation: 29897

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

Upvotes: 1

Ólafur Waage
Ólafur Waage

Reputation: 69991

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

Upvotes: 2

Related Questions