locked
PHP5 on IIS7 in Windows Server '08 - multiple site issues (sic) RRS feed

  • Question

  • User1646422947 posted

    I ws using the excellent tutorial over at http://learn.iis.net/page.aspx/246/using-fastcgi-to-host-php-applications-on-iis-70/ to get PHP5.2.9 up and running on Server '08 and IIS7.

    All was working well, got my site migragated across, code was working, data coming and going out of PostgreSQL in the back end, etc, etc...

    So time to move another couple of sites to the install... and here is where I started to stumble - namely, IIS always 'calls' the PHP file in the first sites 'wwwroot' directory, even from other sites 'based' in other directories!? (assuming there is a PHP file there with the same name...)

    That is, if you go to a PHP page on ANY of the sites with, say, the name 'test.php' the PHP page that is displayed is the 'test.php' site on the FIRST site created in the original 'wwwroot', not the 'test.php' in the directory for that site!!??

    ASP, HTM, etc files are working as you would expect, that is calling them from the right site - and so I set the handler mapping for 'PHP via Fast CGI' to have the same Path Type as 'ASP', namely 'File', as a test - no luck...

    I am thinking that 'PHP via Fast CGI' is somehow erroneously defaulting to the always 'calling' the PHP files of the same name in 'wwwroot'??

    Any advice or suggestions would be GREATLY appreciated, 'cause I am stuck!

    Cheers: GREG...

    Tuesday, March 10, 2009 9:24 PM

All replies

  • User-1653247517 posted

    Can you send request to phpinfo() page for the some other site (for which request is not going to right path) and send the PHP variables part of the output?

    Thursday, March 12, 2009 11:46 AM
  • User1646422947 posted

    Definitely - thanks for your help!, see below, I munged a few things...

    Sorry about the delay in replying, flat out busy!   :-)

    To be frank, I was not sure how to set the info page for one of the 'now-working sites' as it would not got there of course via a browser - so I used the command line "C:\php5\php -info > info.text", although I think I needed to add something to line to get something for the 'bad' site...

    ASIDE - someone  suggested in a private message that I need a php.ini for each site, I also need to look into this...

    Regards,

    GREG...

    -----------------------------------------------------------------------

    PHP Variables

    Variable => Value
    _SERVER["ALLUSERSPROFILE"] => C:\ProgramData
    _SERVER["APPDATA"] => C:\Users\[munge]\AppData\Roaming
    _SERVER["CLIENTNAME"] => [munge]-CF9E619
    _SERVER["CommonProgramFiles"] => C:\Program Files\Common Files
    _SERVER["COMPUTERNAME"] => [munge]
    _SERVER["ComSpec"] => C:\Windows\system32\cmd.exe
    _SERVER["FP_NO_HOST_CHECK"] => NO
    _SERVER["HOMEDRIVE"] => C:
    _SERVER["HOMEPATH"] => \Users\[munge]
    _SERVER["LOCALAPPDATA"] => C:\Users\[munge]\AppData\Local
    _SERVER["LOGONSERVER"] => \\DILITHIUM
    _SERVER["NUMBER_OF_PROCESSORS"] => 1
    _SERVER["OS"] => Windows_NT
    _SERVER["Path"] => C:\PHP5\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\PHP5\;C:\PHP5\ext\;C:\Program Files\PostgreSQL\8.3\bin
    _SERVER["PATHEXT"] => .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
    _SERVER["PHPRC"] => C:\PHP5\
    _SERVER["PHP_PEAR_BIN_DIR"] => C:\PHP5
    _SERVER["PHP_PEAR_DATA_DIR"] => C:\PHP5\pear\data
    _SERVER["PHP_PEAR_DOC_DIR"] => C:\PHP5\pear\docs
    _SERVER["PHP_PEAR_INSTALL_DIR"] => C:\PHP5\pear
    _SERVER["PHP_PEAR_PHP_BIN"] => C:\PHP5\.\php.exe
    _SERVER["PHP_PEAR_SYSCONF_DIR"] => C:\PHP5
    _SERVER["PHP_PEAR_TEST_DIR"] => C:\PHP5\pear\tests
    _SERVER["PROCESSOR_ARCHITECTURE"] => x86
    _SERVER["PROCESSOR_IDENTIFIER"] => x86 Family 6 Model 23 Stepping 6, GenuineIntel
    _SERVER["PROCESSOR_LEVEL"] => 6
    _SERVER["PROCESSOR_REVISION"] => 1706
    _SERVER["ProgramData"] => C:\ProgramData
    _SERVER["ProgramFiles"] => C:\Program Files
    _SERVER["PROMPT"] => $P$G
    _SERVER["PUBLIC"] => C:\Users\Public
    _SERVER["SESSIONNAME"] => RDP-Tcp#0
    _SERVER["SystemDrive"] => C:
    _SERVER["SystemRoot"] => C:\Windows
    _SERVER["TEMP"] => C:\Users\[munge]\AppData\Local\Temp\2
    _SERVER["TMP"] => C:\Users\[munge]\AppData\Local\Temp\2
    _SERVER["USERDNSDOMAIN"] => [munge].COM
    _SERVER["USERDOMAIN"] => [munge]
    _SERVER["USERNAME"] => [munge]
    _SERVER["USERPROFILE"] => C:\Users\[munge]
    _SERVER["windir"] => C:\Windows
    _SERVER["PHP_SELF"] =>
    _SERVER["SCRIPT_NAME"] =>
    _SERVER["SCRIPT_FILENAME"] =>
    _SERVER["PATH_TRANSLATED"] =>
    _SERVER["DOCUMENT_ROOT"] =>
    _SERVER["REQUEST_TIME"] => 1236918400
    _SERVER["argv"] => Array
    (
    )

    _SERVER["argc"] => 0
    _ENV["ALLUSERSPROFILE"] => C:\ProgramData
    _ENV["APPDATA"] => C:\Users\[munge]\AppData\Roaming
    _ENV["CLIENTNAME"] => [munge]-CF9E619
    _ENV["CommonProgramFiles"] => C:\Program Files\Common Files
    _ENV["COMPUTERNAME"] => [munge]
    _ENV["ComSpec"] => C:\Windows\system32\cmd.exe
    _ENV["FP_NO_HOST_CHECK"] => NO
    _ENV["HOMEDRIVE"] => C:
    _ENV["HOMEPATH"] => \Users\[munge]
    _ENV["LOCALAPPDATA"] => C:\Users\[munge]\AppData\Local
    _ENV["LOGONSERVER"] => \\DILITHIUM
    _ENV["NUMBER_OF_PROCESSORS"] => 1
    _ENV["OS"] => Windows_NT
    _ENV["Path"] => C:\PHP5\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\PHP5\;C:\PHP5\ext\;C:\Program Files\PostgreSQL\8.3\bin
    _ENV["PATHEXT"] => .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
    _ENV["PHPRC"] => C:\PHP5\
    _ENV["PHP_PEAR_BIN_DIR"] => C:\PHP5
    _ENV["PHP_PEAR_DATA_DIR"] => C:\PHP5\pear\data
    _ENV["PHP_PEAR_DOC_DIR"] => C:\PHP5\pear\docs
    _ENV["PHP_PEAR_INSTALL_DIR"] => C:\PHP5\pear
    _ENV["PHP_PEAR_PHP_BIN"] => C:\PHP5\.\php.exe
    _ENV["PHP_PEAR_SYSCONF_DIR"] => C:\PHP5
    _ENV["PHP_PEAR_TEST_DIR"] => C:\PHP5\pear\tests
    _ENV["PROCESSOR_ARCHITECTURE"] => x86
    _ENV["PROCESSOR_IDENTIFIER"] => x86 Family 6 Model 23 Stepping 6, GenuineIntel
    _ENV["PROCESSOR_LEVEL"] => 6
    _ENV["PROCESSOR_REVISION"] => 1706
    _ENV["ProgramData"] => C:\ProgramData
    _ENV["ProgramFiles"] => C:\Program Files
    _ENV["PROMPT"] => $P$G
    _ENV["PUBLIC"] => C:\Users\Public
    _ENV["SESSIONNAME"] => RDP-Tcp#0
    _ENV["SystemDrive"] => C:
    _ENV["SystemRoot"] => C:\Windows
    _ENV["TEMP"] => C:\Users\[munge]\AppData\Local\Temp\2
    _ENV["TMP"] => C:\Users\[munge]\AppData\Local\Temp\2
    _ENV["USERDNSDOMAIN"] => [munge].COM
    _ENV["USERDOMAIN"] => [munge]
    _ENV["USERNAME"] => [munge]
    _ENV["USERPROFILE"] => C:\Users\[munge]
    _ENV["windir"] => C:\Windows

    Friday, March 13, 2009 12:30 AM