[Xitami] OT: PHP-Nuke?

Thomas J. Hruska xitami@lists.xitami.org
Thu, 11 Jul 2002 22:11:47 -0400


At 01:23 AM 7/12/2002 +0200, TW writeth:
>Vance,
>didn't mean to be mean with my comment.
>Over time it just got a feeling that a newbie might come to the conclusion 
>that xifusion is a more or less manadatory prerequisite for sucesfully 
>running any php-projekt together with xitami. And this is definitely not 
>the case. In some cases it may be a quick and welcome  workaround to some 
>problem, in general i think its rather a matter of misconception to wrap a 
>coldfusion server around a php-engine.
>Most of all, I believe that virtually no problem with a php-projekt has 
>something to do with the webserver in use.

Tony, the only thing XiFusion does for PHP is correct redirection and a few
minor issues dealing with the environment.  When you use the header()
function in PHP under Apache, Apache will automatically modify the redirect
if it is not an absolute HTTP-compliant URL and may perform additional
processing locally (depends on the situation).  XiFusion essentially does
the same thing, but is actually a side-effect of ColdFusion support.  All
XiFusion does is prepare, start an application, and process the results
passing them back to the server for further processing.  The code base is
something to the tune of 700 lines of C code, so it does quite a bit to fix
Xitami.

I will agree that it won't solve all of the world's problems and isn't
always the perfect solution, but it does work well where redirection issues
arise.  PHP will work fine until you encounter a script that uses relative
redirects.  At that point you either have to change the script, modify
Xitami's source, or use a wrapper like XiFusion.

To test this out try the following:

------index.php------
<?
  header("Location: index2.php");
?>
---------------------

------index2.php------
<?
  echo "Hi There!\n";
?>
---------------------

During the first test don't use XiFusion.  The browser will "hang" because
it does not understand the relative 'Location' header (and isn't required
to according to the HTTP/1.1 standard):

HTTP/1.1 301 Redirect
Server: Xitami v2.4d9
Location: index2.php
...

XiFusion v2.6 corrects this problem by making the relative URL an absolute
URL:

HTTP/1.1 301 Redirect
Server: Xitami v2.4d9
Location: http://localhost/index2.php
...

HTTP/1.1 200 Ok
Server: Xitami v2.4d9
Content-Type: text/html
Content-Length: 10

Hi There!


As you can see, XiFusion does have use in the area of PHP redirects.
Personally, I don't use redirects since they take too long compared to just
include()'ing the file.

Hope this helps!


          Thomas J. Hruska -- shinelight@shininglightpro.com
Shining Light Productions -- "Meeting the needs of fellow programmers"
                  http://www.shininglightpro.com/