Previous Next

Thread: FAST CGI + header not sended

Last post 06-27-2008 9:39 AM by fred_klee. 6 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (7 items)

Sort Posts:

  • 06-23-2008, 5:34 AM

    • fred_klee
    • Not Ranked
    • Joined on 11-23-2007, 7:37 AM
    • Posts 4
    • fred_klee

    FAST CGI + header not sended

    Hello,

    I just went from CGI to FASTCGI with the new fastCGI handler and get some errors with some header :

    I use this header "X-JSON" for web 2.0 issues with prototype,

    example :

    header('X-JSON : A_JSON_STRING ' );

    And this header disappears with PHP in fastCGI mode ?

    There is another problem with all my

    header("Location : A_WELL_FORMATTED_URL")

    Which are located in code, but no text is displayed before it. And with normal CGI it is fonctional and with ISAPI too.

    Should I have to add something in FasCGI configuration or is there a BUG with fast cgi and Headers ?

    I think that thereis a big problem with php headers with FastCGI module !?

    Thanks in advance because whis this problem, I have to rewrite so much code !

     

  • 06-23-2008, 12:46 PM In reply to

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

    Re: FAST CGI + header not sended

    This works well for me:

    <?php
    header('X-JSON: test');
    echo '1';

    Returns:

    c:\>wget.exe "http://localhost/1.php" --spider -S
    http://localhost/1.php => `1.php'
    Resolving localhost... 127.0.0.1
    Connecting to localhost|127.0.0.1|:80... connected.
    HTTP request sent, awaiting response...
      HTTP/1.1 200 OK
      Server: Microsoft-IIS/5.1
      X-Powered-By: ASP.NET
      Connection: keep-alive
      X-JSON: test
      Content-type: text/html
      Content-Length: 0
    Length: 0 [text/html]
    200 OK

    PHP/FastCGI is installed using this instruction: Install PHP with FastCGI

     

  • 06-26-2008, 9:17 AM In reply to

    • fred_klee
    • Not Ranked
    • Joined on 11-23-2007, 7:37 AM
    • Posts 4
    • fred_klee

    Re: FAST CGI + header not sended

    That is not the question because,

    it works well for with CGI and ISAPI..... but NOT with FastCGI.... I think so there is a problem with FASTCGI not my code, I can't put all my header in first line of code... Just think your header is or isn't X-JSON or Location and this arrive at line 100 of your code !

    'cause I want to go with FastCGI, so I don't want to rewrite 1000 lines of code !

     
    Thanks in advance

     

    Fred
     

  • 06-26-2008, 9:42 AM In reply to

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

    Re: FAST CGI + header not sended

    I test all my projects with IIS FastCGI and never have any issue related to headers.

    So, at least the simple example that I've posted works on your computer?

  • 06-27-2008, 2:53 AM In reply to

    • fred_klee
    • Not Ranked
    • Joined on 11-23-2007, 7:37 AM
    • Posts 4
    • fred_klee

    Re: FAST CGI + header not sended

    Hello,

    Sorry for my last answer, I was just spending hours trying to any answer on this problem. And I didn't found any.

    So, I tested your example, first, I got an UNHAUTHORIZED, normal , I use "Integrated Windows authentification".and  wget don't send it. Anyway I went to IIS remove this authentification for tests. And miracle, I test just one URL who has a X-JSON. And got answer with X-JSON.

    Finally, I think that there is a problem with  "Integrated Windows authentification" - FAST-CGI and PHP header ! Together.

    Hope someone can find any answer quickly.

    Thanks in advance.
     


     

  • 06-27-2008, 4:45 AM In reply to

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

    Re: FAST CGI + header not sended

    I've set "Integrated Windows Authentication" and open http://localhost/1/1.php in FireFox (it is configured to send NTLM credentials to localhost) and check the headers with FireBug: "X-JSON: test" header is on the place. So my sample works well with NTML authentication.

     

    Regards,
    Alex

  • 06-27-2008, 9:39 AM In reply to

    • fred_klee
    • Not Ranked
    • Joined on 11-23-2007, 7:37 AM
    • Posts 4
    • fred_klee

    Re: FAST CGI + header not sended

    Hello,

    Thanks for quick support. !

    I just found the answer :

    If you add a stupid "space" beetween "X_JSON" and ":" header would NOT be recognized by FastCGI but recognized by CGI, FASTCGI and APACHE ! (the same with "header("location: http:/...") is not good too.

    It is odd that I could not find any information about this problem anywhere !?  

    Don't ask me why... But it took me so much time to find it.

    Thanks Again 

Page 1 of 1 (7 items)
Page view counter