[Xitami] Xitami PHP Header Redirect issues...

Johannes Prost xitami at pastryworld.ca
Tue Jun 13 20:13:31 CEST 2006


Hi Paul,

I am not a php guy, but I know that the following setting in the php.ini has to be set as

cgi.force_redirect = 0
 otherwise you will have problems with php's redirect to pages. That's the only thing I know to 
look for.

Johannes

> Hi all,
>     I've searched through the archives for this problem as much as
> possible, and I've googled around looking for a solution. I can't find
> one, but if I'm missing something, feel free to point me at the archive
> where it's addressed, beat me senseless, and tell me to go RTFM... :-)
> 
>     I'm considering a switch from that "Patchy" HTTP server to something
> else. IIS is completely out of the realm of possibility, and I've picked
> up Xitami and I'm trying it out. For a reference point on my level of
> skill here, I have Xitami successfully running on both a Windows machine
> and I've also compiled it on my Linux machine without significant issues
> (though "c" and "boomake" did momentarily throw me for a loop, I'll
> admit. But I found an article on that and got it online).
> 
> (In other words, I'm no slouch as a network administrator in both the
> Linux and Windows realms, and I've set up multiple HTTP servers and
> domains over the past 10 years. If this is a case of being incompetent,
> I'll be surprised.)
> 
> So, here's what I've done so far: I've set up Xitami v2.5b6 on both
> Windows and Linux machines. The machine in question here is the Windows
> one.
> 
> (I'd try it on the linux box, but it requires a reconfig of PHP and
> well, production sites are running on it at the moment, so.... :-))
> 
>     I got the default Xitami page to load up.
>     I then set up a virtual host pointing to my PHP based main website.
> I set up the PHP filter and the page loaded up without incident.
>     I set up my remaining, ancillary PHP websites as new virtual hosts.
>     Once that was done without incident, I attempted to sign in to one
> of the PHP sites that requires a login. That... doesn't... work...
> 
> So, here's what I have:
> 
>    1. I have a form on the main page of the site.
>    2. Users type in their alias and password and hit "login" which
>       submits the user's information via POST to a PHP script called
>       "login.php".
>    3. The information gets there, the user's information is validated
>       (which I can see in MySQL's logs).
>    4. Once login.php does its job, the last thing it's supposed to do is
>       redirect the user via a Header Redirect back to the main page
>       after setting some session variables. This is where the train is
>       derailed, so to speak. The header redirect doesn't work.
> 
> So, from there I started doing some debugging to find the problem. I
> created two files.
> 
>     One is a straight HTML file called "success.html". Its content is:
> 
>         "Good News, the redirect was successful!"
> 
>     And the second file is called "index.php". It's content is:
> 
>         < ? php (spaces removed -- I'm not sure what the mailer daemon
>         uses here and don't want to interfere if it's PHP)
>            Header("Location: http://mydomain.com/success.html");
>            Echo "Bad News... It Failed." . chr(13);
>         ? >
> 
>     Every time I visit, no matter what I change, I get "Bad News... It
> Failed." I've tried multiple settings, and I restart Xitami's services
> every time.
> 
> Any ideas? Why is the Header redirect not being honored, either by
> Xitami or by the client browser? Note that the sites are running
> successfully under that "Patchy" web server...
> 
> Oh, and before I forget... debug is on, and I'm seeing nothing in the
> logs to tell me that anything is wrong.
> 
> Thanks (in advance) for your help!
> (Please don't mind me while I bang my head against a wall over here.)
> -- 
> Paul Webb
> WebbEnabled Solutions, LLC (vCard
> <http://www.webbenabled.com/%7Epwebb/vcard/WebbPaul.vcf>)
> <mailto:pwebb at webbenabled.com>
> 

Johannes





More information about the Xitami mailing list