Where does localhost/ search for files in Windows IIS directory

DeadSeaSquirrels

Senior member
Jul 30, 2001
515
0
0
I am just starting to learn IIS, php, and mySQL and I'm trying to run those on my local computer so that I can test my pages without having to upload every 3 seconds to my hosting company. One thing that doesn't seem to work is this. I have a very simple PHP file. All it really does is spit out html. But for some reason it isn't linking to my graphics appropriately.

I have all my webpage files in the ../inetpub/wwwroot directory, and all my pics in a directory labeled HTML under the ../inetpub/wwwroot directory (../inetpub/wwwroot/HTML). Then in my index.php file I have references to my image files as something like this:

<img src="HTML/logowbgd.gif" width="265" height="110">

on my hosted site, everything works fine, so I think I have an idea as to where the webserver/php server is looking for the files. I would imagine "HTML/logowbgd.gif" means stating in the directory the index.php is in, and then going to the HTML directory and looking for logowbgd.gif. But for whatever reason it only gives me deadlinks. I am just wondering if IIS is looking in another directory or something. I doubt it is a simple spelling mistake, since i just grabbed the files from my original hosting company's servers. Does anybody have any idea what is going on?
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
Find the IIS logs, they probably tell you the path to the file it couldn't find.
 

Kappo

Platinum Member
Aug 18, 2000
2,381
0
0
I would try putting "/HTML/logowbgd.gif" instead. I cannot seem to remember which one it is that complains about certain slashes in certain places. I usually use an absolute url, though. Like for me it would be "../mainsitedirectoryname/HTML/stickfigurelogo.gif". But it is because I am picky and sometimes need to change the directory of my images.
 

Kappo

Platinum Member
Aug 18, 2000
2,381
0
0
LoL yes you are right, I was thinking about absoute and typed a relative ;)
 

DeadSeaSquirrels

Senior member
Jul 30, 2001
515
0
0
That's the big question I guess, where is the webserver searching relative to? When I look at the html it reads

<img src="HTML/logowbgd.gif" width="265" height="110">

like I mentioned, but when I right-click on the dead link image, it reads http://localhost/HTML/... which just kind of brings me back to square one since, http://localhost isn't a directory exactly, it is like a place holder for the webserver. I just need to figure out what that refers to on my harddrive. I'll check out the log and see if I can find anything. Thanks
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
IME it should be relative to the file containing the referance. So the only way HTML/blah.jpg would work is if blah.html is in the directory above HTML/ .
 

spyordie007

Diamond Member
May 28, 2001
6,229
0
0
Originally posted by: Nothinman
Find the IIS logs, they probably tell you the path to the file it couldn't find.
quit beating around the bush and review the log files as it was suggested