> I am running a cgi program on Red Hat 6.2 under my wed browser such as
> "http://localhost/cgi-bin/prog.cgi",
> it runs normally, however, all the gif graphics can't display normally.
>
> I am trying to copy all of the *.gif file to the directory
> "/home/httpd/cgi-bin/",
> "/home/httpd/html/" and "/home/httpd/" both of them gets the same results.
>
> And I try point the mouse to the any gif graphic right click it
> and select
> "view image"
> in the wed browser. It displayed the following error message.
>
> --->
> Internal Server Error
This is usually caused by your script having a different working directory
than where your images are.
i.e. if you do
<IMG SRC=pic.gif>
then the server looks for a file
http://localhost/cgi-bin/pic.gif
i.e.
/home/httpd/cgi-bin/pic.gif
Of course, you can't put pic.gif in the cgi-bin directory because the server
will probably try to execute it (which explains the "Internal Server
Error").
There are a couple of ways to fix this:
1) Use paths in your links/images:
<IMG SRC=/pic.gif>
<IMG SRC=../pic.gif>
2) Use the HTML tag BASE:
<HEAD>
<BASE HREF=http://your-server.domain/directory/>
</HEAD>
(2) is preferable over (1) if you plan to run your script on another server.
You may need to fiddle a little to get the directory right. Just look at
what URL your browser is trying to fetch, and modify your BASE / links
accordingly.
Zoltan.
---
You are currently subscribed to perl-win32-users as: [archive@jab.org]
To unsubscribe, forward this message to
[EMAIL PROTECTED]
For non-automated Mailing List support, send email to
[EMAIL PROTECTED]