We are excited to announce that the IIS.NET Forums are moving to the new Microsoft Q&A experience. Learn more >

Path Differences between CGI and ISAPI [Answered]RSS

3 replies

Last post Jul 30, 2007 02:59 AM by GeorgeZ

  • Path Differences between CGI and ISAPI

    Jul 26, 2007 07:59 PM|lordandy|LINK

    Dear Community!



    I installed PHP 5.2 on a Windows 2003 Server. My Document Root Folder is d:\inetpub\website. If I run PHP as CGI-extension and do an include("./inc.test.php"), I don't have any problems. If i print out real_path("/") i get back "D:" as it should be I think.

     If i change now to run PHP as an ISAPI extension, i get include-errors, the file cannot be found. If i print out real_path("/") i get back "C:"

     

    Does anyone know how I can change this, or where I can find a starting point for searching?

     

    Regards, Andy
     

    PHP Isapi CGI Path

  • Re: Path Differences between CGI and ISAPI

    Jul 26, 2007 11:13 PM|rickjames|LINK

    What do the two implementations return for: http://php.net/manual/en/function.getcwd.php

    Could you use something like DOCUMENT_ROOT or PHP_SELF instead of '.'?

  • Re: Path Differences between CGI and ISAPI

    Jul 27, 2007 04:13 AM|lordandy|LINK

    As CGI-Extension, getcwd() returns d:\inetpub\website as it should be, but as isapi extension, i get back "c:\windows\system32\inetsrv".

     

    I could use somthing like that instead of "./" but the problem is the site is completely programmed and it would be a lot of work to change it everywhere 

  • Re: Path Differences between CGI and ISAPI

    Jul 30, 2007 02:59 AM|GeorgeZ|LINK

    I got someone is doing this way:

    http://www.thescripts.com/forum/thread161.html

    http://www.thescripts.com/forum/thread337.html