December 4th, 2003, 11:22 AM
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.
December 4th, 2003, 06:44 PM
.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.
December 9th, 2003, 09:46 AM
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 09:58 AM.