suphp and apache2

lol :slight_smile:

Well if I understand well you have to install both php4 and php5 as CGI. (so I think in /usr/bin/php and /usr/bin/php5 for example but the sapi not the CLI)

Then suPHP handle .php5 with /usr/bin/php5 and .php4 with /usr/bin/php

It’s how I think it works

But as I didn’t install it yet, I don’t really know.

It’s a hard decision for us to give a GO or NO GO for suPHP. What is sure it is that we will give it a try and see.

: :: To CHIS (if read by a iworx guy) :::
Do you think it could be easy to change your php5 srpm to install it under /etc/php5 and the sapi in /usr/bin/php5 and not php. To allow us to install it in parrallel of php4 ?

Pascal

Does suPHP run on 64 bit?

Something I didn’t even think about, will suPHP run on a 64 bit machine?

So Pascal that just means we install PHP5 into the system (as php5 instead of php) and then instead of using mod_php, we use mod_suphp which will call the executables directly and will call the right one based on code similar to my above post?

And then I guess you could leave mod_php active for those sites you dont want to suPHP, but then mod_php would only work with php and not php5.

Am in still in the ballpark?? :confused:

Im not sure if I really understand what it means to run as a CGI vs mod_php, but I guess just allowing suPHP to call the php executables is “CGI” and using mod_php for apache is a mod b/c apache is directly using the php executable.

Also, how would having a php (php 4.x) and php5 (php 5.x) installed on the system at the same time effect yum updates??

Here is the link where I got the code info above: http://72.14.207.104/search?q=cache:Z0rv_8L1PtQJ:sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/proj/en/php/php4-php5-configuration.xml%3Frev%3D1.2+suphp+php4+and+php5+on+same+box&hl=en&gl=us&ct=clnk&cd=30&client=firefox-a

Justec in our case here is what we plan. There is few solutions but here is ours :

You can use php as a module or as a CGI. If it is used as a CGI it is exxctly as Perl or others CGI. You have to create and handler / action in httpd or add the shebang in all php that have to be run as CGI.

To have both php4 and php5 running on the same server we must have on running as module and the other as cgi or the both as CGI. If both are ran as CGI then you create to handler in httpd. For example one or all .php link to /usr/bin/php and the other for all .php5 link to /usr/bin/php5

We do not allow yum to update php :slight_smile:

So in our case we would like to first install php5 as CGI and use it with suPHP, make a lot of tests and maybe finally also migrate the config to have also our existing php4 run as CGI + suPHP.

I’ve done some tests on my local machine and both works. (php4 as module + php5 suphp and php4 suPHP + php5 suPHP)

If you use both as CGI with suPHPP you’?ll also have to define where is every php.ini (the one of php4 and the one of php5)
We have done this like this

<Files *.php>
SetEnv PHPRC /path/to/php.ini/folder/for/php4 </Files>

<Files *.php5>
SetEnv PHPRC /path/to/php.ini/folder/for/php5
</Files>

It might be per a vhost file or in the general httpd

But it’s true there is also others solution like fastCGI. We currently being peform some tests to have a separate php lstener on the ip 127.0.0.1 and handle per fastCGI

I’ll let you knoy hoy everything is and if you need do not hesitate

Pascal

Yes it is exactly like (one of the solution) this you can handle two php version on the same box.

Pascal

: :: To CHIS (if read by a iworx guy) :::
Do you think it could be easy to change your php5 srpm to install it under /etc/php5 and the sapi in /usr/bin/php5 and not php. To allow us to install it in parrallel of php4 ?

It should be doable. I responded to your other thread on the matter and hopefully it’s an easy change.

Chris

Thank you Chris.

For all others here is the post:

http://www.interworx.com/forums/showthread.php?p=8445#post8445

easy… Well there is a lot of workarounds in this spec (which are normal and server well their purpose :wink: ), and I really have to change them carrefully. But I’ll test.

Pascal