• Advertisement

Archived

This topic is now archived and is closed to further replies.

IIS and php

This topic is 5099 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Well I have my website in my localhost folder. Everything works fine, but if the user tries to access the php driven part of my site he''s asked for a password and user name, why? Oh the php files are in a folder called cgi-bin, could that be the problem? -CProgrammer

Share this post


Link to post
Share on other sites
Advertisement
CProgrammer:
php files are normally not run from cgi-bin/ folders. php can run from anywhere under DocumentRoot provided you have a php engine compiled into the web server. I am not sure how or even if IIS will run php code.
With the type of error you are getting, check your IIS setup, search for default.htm(l) and index.htm(l) as this will probably tell you where the default files are. place your php files there and then try to access them. If you get the same errors then you might want to check the permissions on the files/folder as Arild Fines suggested.

Share this post


Link to post
Share on other sites
From the tests i''ve made I assume that putting all the php files into the root directory(e.g. wwwroot) would solve the problem. However I don''t really want this, because it would make the root directory messy, plus i''d have to change all the links.
Oh and I tried tons of variations of folder permissions of cgi-bin. It seems IIS always asks the user of my site for a password when he accesses content in a folder with set permissions. Folders without any access permissions work fine, but obviously cant execute php scripts.
Oh and if I just test the site under http://localhost all works great. If i use my ip address as a user would it works fine except for the content of cgi-bin(directory with folder permissions set).
Geeze what to do.
-CProgrammer

Share this post


Link to post
Share on other sites
in the wwwroot/ folder you could create a folder scripts/ and place your php files there.

In your cgi-bin/ folder try running a simple perl script from there name it something like test.pl and see what happens.

As far as the password problem, look and see if there is a hidden .htaccess file in your cgi-bin/ directory.
I wish I knew IIS a little better to help you out with problem.

What you might think about doing if possible is run apache. I here the windows version has some very naughty bugs though. If you are interested in running a version *nix that could be another option.

Is this for a personal site or commercial?

Share this post


Link to post
Share on other sites
Thanks for the reply.
I''ll search for the htaccess file and try out your other suggestions as soon as I get home.
Oh and this is gonna be a private site.
-CProgrammer

Share this post


Link to post
Share on other sites
IIS doesn''t use .htaccess files.

The problem should not be occuring, and may have to do with the permissions on the file system/folder and the network user.

Your PHP scripts also really don''t belong in cgi-bin, since they''re not executed via CGI.

Share this post


Link to post
Share on other sites
quote:
Original post by Arild Fines
Well, theoretically, he *could* be running PHP through CGI...
True. Inefficient, but quite possible.

Btw, have you ever used Python for ASP development (assuming you do ASP development)?

Share this post


Link to post
Share on other sites
No, I don''t do ASP. I''ve done the odd page in ASP.NET/C#, but that''s all.

Hm, well, I tried to get ViewCVS running under IIS once. It had an ASP page written in Python. But I couldn''t get it working, so I gave up and reverted to Apache and mod_python instead.

Share this post


Link to post
Share on other sites
Well considering the fact that the ''cgi-bin'' folder is just a folder created by me I thought the name shouldnt matter. Are you guys suggesting that the name cgi-bin is merely reserved by IIS and therefore treated differently?
I think its got something to do with the folder permissions or possibly with the options of IIS in general(although I dont know where and how to change anything there).
My permissions are:
Write(checked)
Read(checked)

Access:
Execute
(I tried ''scripts'' as well.)

-CProgrammer

Share this post


Link to post
Share on other sites

  • Advertisement