Previous Next

Thread: FastCGI and PHP header

Last post 05-15-2008 3:06 PM by sbock98. 4 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (5 items)

Sort Posts:

  • 05-13-2008, 2:32 PM

    • sbock98
    • Not Ranked
    • Joined on 05-13-2008, 2:26 PM
    • Posts 3
    • sbock98

    FastCGI and PHP header

    I just installed fastcgi and php 5.2.6.  Everything is working great except for my php headers.  My code is just the standard header("Location: URL");  Is this supported with fastcgi?  I'm running IIS6.

    Thanks for the help.
     

  • 05-13-2008, 2:50 PM In reply to

    • ruslany
    • Top 50 Contributor
    • Joined on 07-01-2007, 3:38 PM
    • Redmond, WA
    • Posts 92
    • ruslany

    Re: FastCGI and PHP header

    This should work with FastCGI. What error do you get? Does your script call header() before any actual html output is sent?

    http://ruslany.net
  • 05-13-2008, 3:12 PM In reply to

    • sbock98
    • Not Ranked
    • Joined on 05-13-2008, 2:26 PM
    • Posts 3
    • sbock98

    Re: FastCGI and PHP header

     Yea, my php is at the very top of the page.  I use a $_GET to grab the value of a variable that is passed through the url.  If that variable doesn't exist, then i use header() to redirect to the same page, but with the variable.  I don't get a specific error for the header(), but i get an error later on in the code because the original variable isn't there. 

     I was running php on isapi and everything was working great.  As soon as i moved to fastcgi, things stopped working.
     

  • 05-14-2008, 9:21 PM In reply to

    • Alex.W474
    • Top 100 Contributor
    • Joined on 05-15-2008, 1:16 AM
    • Posts 26
    • Alex.W474

    Re: FastCGI and PHP header

    The following code works well for me:

    File: redirect.test.php 

    <?php

    if (!isset($_GET['flag'])) {
        header('Location: redirect.test.php?flag=1');
        exit();
    }
    echo 'ok';

     

    WIndows XP Pro with PHP 5.2.6, IIS 5.1, installed as follows: http://www.witsuite.com/support/knowledge-base/manual-installation/install-php.php

  • 05-15-2008, 3:06 PM In reply to

    • sbock98
    • Not Ranked
    • Joined on 05-13-2008, 2:26 PM
    • Posts 3
    • sbock98

    Re: FastCGI and PHP header

    That code works for me too.  My original code was just getting the variables from the URL, then checking to see if they were NULL, then redirecting.  I was thinking it could be a php coding issue rather than an fastcgi issue.  Thanks for the help!  Everything is working now.

Page 1 of 1 (5 items)
Page view counter