Running both PHP4 and PHP5?

Support/Development for PHP
cormander

Running both PHP4 and PHP5?

Unread post by cormander »

I've tried running both, but so far no luck.

I'm thinking this logically will work, but havn't actually been able to do it yet.

Build PHP5 to create some of its files as follows:

/usr/bin/php5
/etc/php5.ini
/usr/lib/httpd/modules/libphp5.so
/etc/httpd/conf.d/php5.conf

The goal here is to not conflict with any php4 files, and to only load .php5 extnetions with PHP5, so httpd will start up loading both.

Anywone got words?

-Corey
scott
Atomicorp Staff - Site Admin
Atomicorp Staff - Site Admin
Posts: 8355
Joined: Wed Dec 31, 1969 8:00 pm
Location: earth
Contact:

Unread post by scott »

yep thats how my php5 rpm is set up, although I didnt try and get it working with 4 at the same time. Rough guess but I'd say you're going to run into php.ini issues (thats where you set the module paths) trying to run both together.
cormander

Unread post by cormander »

Am I wrong to think that php5 files read the php5.ini and ignore the php.ini , and vise virsa?

I haven't been able to find any php5 rpms of yours, could you direct me to them? Preferably for fedora, and if possible have the src rpm as well.

I'll see if I can get them to work off of what you've already done.

-Corey
scott
Atomicorp Staff - Site Admin
Atomicorp Staff - Site Admin
Posts: 8355
Joined: Wed Dec 31, 1969 8:00 pm
Location: earth
Contact:

Unread post by scott »

It uses php.ini, but Im sure with some hacking you can change it. The src.rpms are in the 3es.atomicrocketturtle.com/packages/ (linked at the bottem of every download page)
hotgazpacho

Specifying an alternate INI file location

Unread post by hotgazpacho »

This can be done in the Apache httpd.conf file, using the PHPIniDir directive.
For example,

Code: Select all

PHPIniDir "/etc/php4"
This works with PHP 4.3 and 5.

The only problem is that you can only specifiy one PHPIniDir directive, thus you cannot run PHP 4 and 5 simultaneously with both as modules using this method.

I don't think it is possible to run more than one PHP version and have them all be modules. The only way I have heard of so far is to run one as a module and the other(s) as a CGI interpreter.
Post Reply