[Xitami] localhost problems..
Ewen McNeill
xitami@lists.xitami.org
Sat, 18 Aug 2001 10:23:32 +1200
In message <3B7D7372.1062E0D7@esite-me.net>, Dan Fisher writes:
>So if I try http://localhost/FisherWeb/, it does not like my index.htm file:
><HTML>
><HEAD></HEAD>
><BODY BGCOLOR="#FFFFFF">
><? php header("Location:
>http://localhost/FisherWeb/menu.php?menu=1&submenu=0"); ?>
></BODY>
></HTML>
I'm not absolutely certain with PHP, but I think that it's getting
rather late to be thinking about outputting HTTP headers whenyou've
already output half of the HTML! (For it to work, PHP would have to
scan the whole page and process the header directives first, before
outputting any of the page.)
Try turning on CGI debugging ([CGI] debug=1), and then look at the
temporary file output by accessing that page via the PHP filter. Unless
the Location: line appears at the top of the file (in the headers
section), it won't work.
>or my index.php file:
><? header("Location: menu.php?menu=1&submenu=0"); ?>
>
>But if I enter http://localhost/FisherWeb/menu.php?menu=1&submenu=0
>directly, it works.
This won't work because you're trying to use a relative URL for your
Location: header, and Xitami doesn't support that. You should either
use a full "http://.../..." URL for a client side redirect, or a full path
reference "/FisherWeb/menu.php?...." for a server side redirect.
>Also, I have noticed lately that when I make a change to Xitami,
>terminate and attempt to restart, it complains that the port is already
>in use. I have to reboot the machine to get to work again.
You _probably_ won't have to reboot the machine providing whatever is
using the port is stopped correctly. But if you interupt a connection
which Xitami thinks is open, then you may have to wait for the "closing
connections" phase before you can restart it.
Try:
netstat -nr
from a command shell, and look to see if there are any lines for port
80 (http), particularly any that mention being in a CLOSE phase (or even
"listening").
Typical timeouts is about 5 minutes or so. Xitami tries to tell the
operating system not to wait in this instance, but it may not get it
right for every operating system.
Ewen
--
Ewen McNeill, Technical Consultant, iMatix Corporation www.imatix.com