#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2003
    Location
    Brighton, UK
    Posts
    2
    Rep Power
    0

    Question PHP files "not found" in passworded IIS folders


    I've got some PHP scripts in an .htaccess-protected folder on an IIS 5.0 server that are returning "404 not found" when I try to access them (rather than returning a 401 error and prompting the user to give a username and password).

    If I access a non-PHP file, such as a static HTML or an ASP script, I get prompted for login and can connect, and can then access the PHP scripts as normal. Going straight to a PHP file before I've logged in always gives a 404, though.

    Any idea what might be causing this? I've found stuff about having to enable locked-down-by-default dynamic content in IIS, but that only seems to be a 6.0 thing.
  2. #2
  3. No Profile Picture
    Grumpier old Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jun 2003
    Posts
    14,428
    Rep Power
    4539
    .htaccess is an Apache feature, not IIS. Use windows explorer to set permissions.

    IIS uses a default local user account until it hits something that forces user authentication, after which it impersonates the logged on user. I suspect there is some permissions issue between the php isapi and the php files when IIS is operating in the default context, which goes away when the user gets logged on.

    Maybe you could give the IUSR_computername user account execute permissions to the php files to get them to work prior to a login, but that might defeat the whole login scheme.
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2003
    Location
    Brighton, UK
    Posts
    2
    Rep Power
    0
    Sorry, yes, didn't mean .htaccess.

    Have fixed the problem, anyway - if anyone else has had the same problem and found this page, you have to enable Check that file exists for PHP files in Home Directory / Configuration, in the IIS Manager. Rather counter-intuitive, but there we go.
    Last edited by Kevan; December 9th, 2003 at 08:58 AM.

IMN logo majestic logo threadwatch logo seochat tools logo