This is a discussion on Running PHP 4 and PHP 5 together on Apache/Linux within the alt.comp.lang.php forums, part of the PHP Programming Forums category; Folks, We have been running PHP 4.x on Apache 1.3.x with no problems. After the first upgrade ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Folks,
We have been running PHP 4.x on Apache 1.3.x with no problems. After the first upgrade from php3 -> php4 were were able to load both modules for php 3 and php 4 with no problem. With an AddType directive we forced php 3 execution for just those files ending in php3. Thought we could do the same with php 5. We have a lot of folks on 4 who may not be ready to upgrade yet, so we were planning on letting php 4 handle anything ending in ..php or .php4 -- and use php 5 for just php5 extensions. Did the same thing as before in our Apache Config, we are running on Redhat 9 -- but can't get both 4 and 5 running together. It seems we can run one or the other, but not both -- when we start apache we get ONE server process that just sits there, nothing in the log files? After some web searching could not find much, one guy said there was a conflict in memory management and you can't run the two together? Anyone got this to work and how? Thanks! -- John __________________________________________________ _________________ John Murtari Software Workshop Inc. jmurtari@following domain 315.635-1968(x-211) "TheBook.Com" (TM) http://thebook.com/ |
|
|||
|
Because of the recommendation to run PHP4 with Apache 1.3 and PHP5
with Apache 2 I would suggest you implement two Apache servers. One, for example, listing on port 80 and one on port 81. So to test one version, you could use one port. There is no problem with running more than one apache on one machine as long as they listen to different ports. Best regards, - Marc Speauw John Murtari <jmurtari@thebook.com> wrote in message news:<x78yddb7t2.fsf@hammer.thebook.com>... > Folks, > We have been running PHP 4.x on Apache 1.3.x with > no problems. After the first upgrade from php3 -> php4 were > were able to load both modules for php 3 and php 4 with no > problem. With an AddType directive we forced php 3 execution > for just those files ending in php3. > > Thought we could do the same with php 5. We have a > lot of folks on 4 who may not be ready to upgrade yet, so > we were planning on letting php 4 handle anything ending in > .php or .php4 -- and use php 5 for just php5 extensions. > > Did the same thing as before in our Apache Config, > we are running on Redhat 9 -- but can't get both 4 and 5 > running together. It seems we can run one or the other, but > not both -- when we start apache we get ONE server process > that just sits there, nothing in the log files? > > After some web searching could not find much, one > guy said there was a conflict in memory management and > you can't run the two together? > > Anyone got this to work and how? > Thanks! |
|
|||
|
> John Murtari <jmurtari@thebook.com> wrote in message news:<x78yddb7t2.fsf@hammer.thebook.com>... > > Folks, > > We have been running PHP 4.x on Apache 1.3.x with > > no problems. After the first upgrade from php3 -> php4 were > > were able to load both modules for php 3 and php 4 with no > > problem. With an AddType directive we forced php 3 execution > > for just those files ending in php3. > > > > Thought we could do the same with php 5. We have a > > lot of folks on 4 who may not be ready to upgrade yet, so > > we were planning on letting php 4 handle anything ending in > > .php or .php4 -- and use php 5 for just php5 extensions. > > > > Did the same thing as before in our Apache Config, > > we are running on Redhat 9 -- but can't get both 4 and 5 > > running together. It seems we can run one or the other, but > > not both -- when we start apache we get ONE server process > > that just sits there, nothing in the log files? > > > > After some web searching could not find much, one > > guy said there was a conflict in memory management and > > you can't run the two together? > Because of the recommendation to run PHP4 with Apache 1.3 and PHP5 > with Apache 2 I would suggest you implement two Apache servers. > One, for example, listing on port 80 and one on port 81. So to test > one version, you could use one port. There is no problem with running > more than one apache on one machine as long as they listen to > different ports. > > Best regards, > - Marc Speauw Wow, never heard of the recommendation to run it on 2.x I went back to the php site and reviewed some of their install stuff, but couldn't find anything on that. Thanks for the suggestion on the alternate port number, but we run a lot of folks, separate web sites, and it could get a bit messy putting those tweaks in. What I'd really like to know is has anyone been able to get PHP 4 and 5 running together -- or soes anyone know if this is definitely not possible (then we will explore the other options). Many thanks! -- John __________________________________________________ _________________ John Murtari Software Workshop Inc. jmurtari@following domain 315.635-1968(x-211) "TheBook.Com" (TM) http://thebook.com/ |
|
|||
|
John Murtari wrote:
> What I'd really like to know is has anyone been able to > get PHP 4 and 5 running together -- or soes anyone know if this > is definitely not possible (then we will explore the other options). Yes it is possible (dont know if you read french: http://www.ovh.com/fr/ovh/news/index...ype=theme&id=3 So yes it is possible. > Many thanks! HTH, Sebastian -- The most likely way for the world to be destroyed, most experts agree, is by accident. That's where we come in; we're computer professionals. We cause accidents. --Nathaniel Borenstein |
|
|||
|
On 21 Jul 2004 13:15:37 -0400, John Murtari <jmurtari@thebook.com>
wrote: >Folks, > We have been running PHP 4.x on Apache 1.3.x with >no problems. After the first upgrade from php3 -> php4 were >were able to load both modules for php 3 and php 4 with no >problem. With an AddType directive we forced php 3 execution >for just those files ending in php3. > > Thought we could do the same with php 5. We have a >lot of folks on 4 who may not be ready to upgrade yet, so >we were planning on letting php 4 handle anything ending in >.php or .php4 -- and use php 5 for just php5 extensions. > I've not used PHP5, but a quick scan of the documentation seems to suggest that PHP5 triggers from the same content-type that PHP4 does, so the standard distros will likely conflict. I'm not really an expert on Apache's or PHP's internals, but perhaps it is possible to define at compile time, either by a configure option or just by hacking some of the code, a different trigger type than application/x-httpd-php . Alternatively, for now you could use the CGI version of PHP5. While most of your users are on PHP4, the CGI overhead will hopefully be small. Later when the balance shifts you can swap and have PHP4 by the CGI process. AddType application/x-httpd-php5 .php5 Action application/x-httpd-php5 "/php-bin/php5" If you're talking about "virtual hosting" sites, you'll have to map the php-bin directory into all of their URLspaces using a global Alias directive, of course. It's probably best to have the binary be called 'php5' in case some of your users configure additional mappings for PHP5 in an .htaccess file; this way, if you choose to switch to php4 being the CGI process in the future you can leave the php5 binary there for the few users who depend on it and thus not break those sites. Good luck, -Claire |
|
|||
|
Sebastian Lauwers <dacrashanddie@9online.fr> writes:
> John Murtari wrote: > > > What I'd really like to know is has anyone been able to > > get PHP 4 and 5 running together -- or soes anyone know if this > > is definitely not possible (then we will explore the other options). > > Yes it is possible (dont know if you read french: > http://www.ovh.com/fr/ovh/news/index...ype=theme&id=3 > > So yes it is possible. > > > Many thanks! > > HTH, > Sebastian > Okay, thanks, with the help of http://babel.altavista.com/ I was able to get through the French and it sounds like they were running both together. We may be solving this, it was noted that in our AddType a different application name was used when we were doing application compatability with php3, i.e. x-httpd-php3 # AddType application/x-httpd-php3 .php3 AddType application/x-httpd-php5 .php5 AddType application/x-httpd-php .php4 .inc .inf .phtml We just realized that the person that had build that older version of php3 must have changed something in its build process so it identified itself differently to Apache (which make perfect sense). We are looking through the build process now. Right now we are referencing an x-httpd-php5 which does not exist -- I am surprised that it causes Apache to turn cartwheels without any errors being logged? We see one process which looks to be in some type of infinite loop. Hopefully we'll be able to post a method soon. -- John __________________________________________________ _________________ John Murtari Software Workshop Inc. jmurtari@following domain 315.635-1968(x-211) "TheBook.Com" (TM) http://thebook.com/ |
|
|||
|
On 22 Jul 2004 15:47:19 -0400, John Murtari <jmurtari@thebook.com>
wrote: > We are looking through the build process now. Right now >we are referencing an x-httpd-php5 which does not exist -- I am >surprised that it causes Apache to turn cartwheels without any >errors being logged? We see one process which looks to be in some >type of infinite loop. > > Hopefully we'll be able to post a method soon. If you get this working, would you mind emailing me the patches for getting PHP5 to work with PHP4? I'd appreciate it. |
|
|||
|
John Murtari wrote:
> Okay, thanks, with the help of http://babel.altavista.com/ I was > able to get through the French and it sounds like they were running > both together. > > We may be solving this, it was noted that in our AddType > a different application name was used when we were doing application > compatability with php3, i.e. x-httpd-php3 > > # AddType application/x-httpd-php3 .php3 > AddType application/x-httpd-php5 .php5 > AddType application/x-httpd-php .php4 .inc .inf .phtml > > We just realized that the person that had build that older > version of php3 must have changed something in its build process > so it identified itself differently to Apache (which make perfect > sense). We are looking through the build process now. Right now > we are referencing an x-httpd-php5 which does not exist -- I am > surprised that it causes Apache to turn cartwheels without any > errors being logged? We see one process which looks to be in some > type of infinite loop. > > Hopefully we'll be able to post a method soon. I've found couple of links that might interest you. I must say first that it doesn't seem possible to put the two php versions on module as i first said, well, it doesn't seem to go at first look. http://www.circle.ch/wiki/index.php?...llation%2FPHP5 Check the tricks part. HTH, S. -- The most likely way for the world to be destroyed, most experts agree, is by accident. That's where we come in; we're computer professionals. We cause accidents. --Nathaniel Borenstein |
|
|||
|
On 22 Jul 2004 15:47:19 -0400, John Murtari <jmurtari@thebook.com>
wrote: [snip] >Right now >we are referencing an x-httpd-php5 which does not exist -- I am >surprised that it causes Apache to turn cartwheels without any >errors being logged? We see one process which looks to be in some >type of infinite loop. > AddType can assign any valid (and probably some invalid) MIME type specifier to any file extension. Normally, these are used in the Content-type header in the response to the user, but PHP intercepts a "magic" type which causes the engine to run. Inventing a non-existant type will just make .php5 files be served as that type, which is why you don't see any error. I don't know why it went into an infinite loop, though. I suspect it was a bad interaction between the two loaded PHP modules unrelated to that particular AddType directive. Best regards, -Claire |
|
|||
|
Folks,
Thanks for the messages. I thought we would have a solution but nothing yet. I did go back to our old php 3 installation where we had both php 3 and php 4 running together as modules. As you note below the php3 looks like it was build to associate with a different MIME type as Claire suggested. (SU-clamp)/usr/local/etc/httpd/libexec>strings libphp3.so | grep x-httpd application/x-httpd-php3-source application/x-httpd-php3-preprocessed application/x-httpd-php3 application/x-httpd-php3 (SU-clamp)/usr/local/etc/httpd/libexec>strings libphp4.so | grep x-httpd application/x-httpd-php application/x-httpd-php-source So..... we went into the php 5 source tree (unfortunately what I don't have is our actual old build tree for php 3 -- but we may end up restoring it from tape). We looked for every instance of x-httpd in the source and found (note, we changed x-httpd-php -> x-httpd-php5): ../main/php.h:#define PHP_MIME_TYPE "application/x-httpd-php5" ../sapi/apache/mod_php5.c: {"application/x-httpd-php5", send_parsed_php}, ../sapi/apache/mod_php5.c: {"application/x-httpd-php5-source", send_parsed_php_source}, ../sapi/apache_hooks/mod_php5.c: {"application/x-httpd-php5", send_parsed_php}, ../sapi/apache_hooks/mod_php5.c: {"application/x-httpd-php5-source", send_parsed_php_source}, We did a clean configure and I really thought we had it -- it built fine and installed -- but still did not work! Giving us the same issues as earlier postings. It would run standalone actually fine, i.e. the x-httpd-php5 mime type was connecting to php5, we were able to display proper content on a phpinfo.php5 file -- BUT, it still would not work with php4 even though that was associated with another mime type, i.e. LoadModule php4_module libexec/libphp4.so LoadModule php5_module libexec/libphp5.so .... AddModule mod_php4.c AddModule mod_php5.c .... # AddType application/x-httpd-php .php4 .inc .inf .phtml AddType application/x-httpd-php5 .php5 If we comment out one of the "AddType" statements the server will restart properly. Would like to avoid the CGI approach to this and it seems like this "ought" to work -- it sure would make it easy to roll out php5 for people without having to worry about breaking stuff during a transition period. -- John __________________________________________________ _________________ John Murtari Software Workshop Inc. jmurtari@following domain 315.635-1968(x-211) "TheBook.Com" (TM) http://thebook.com/ |