in reply to Re: image not shown in my web page
in thread image not shown in my web page

Thanks for the response point 1) checked manually with file:///C:/Server/Apache2/cgi-bin/pics/PD4.jpg.IT works. 2) not sure about this 3) no error on the log.Its just that everything works except the image. 4) is there any work around if apache wont server images ? Please help.

Replies are listed 'Best First'.
Re^3: image not shown in my web page
by Corion (Patriarch) on May 05, 2011 at 11:31 UTC

    Why do you manually check

    file:///C:/Server/Apache2/cgi-bin/pics/PD4.jpg

    if you use

    http://localhost/cgi-bin/pics/PD4.jpg

    in your code?

    What error do you get in the logs for the image?

    Also, read the Apache documentation on how to configure Apache. This has nothing to do with Perl. You will need to configure Apache so that it serves images from a directory. This directory should not be cgi-bin.

Re^3: image not shown in my web page
by Anonymous Monk on May 05, 2011 at 11:39 UTC
    checked manually with file:///C:/Server/Apache2/cgi-bin/pics/PD4.jpg.IT works.

    file: is not http: If you're trying to debug a problem with http://localhost.... you don't reach for file:

    not sure about this

    Yeah, the file: bit gave it away, which is why you should take the time now to learn about the internet.

    This is one way you might check

    $ lwp-request -USEd http://127.0.0.1:5000/ GET http://127.0.0.1:5000/ User-Agent: lwp-request/6.00 libwww-perl/6.02 200 OK Date: Thu, 05 May 2011 11:36:49 GMT Date: Thu, 05 May 2011 11:36:49 GMT Server: HTTP::Server::PSGI Content-Length: 6064 Client-Date: Thu, 05 May 2011 11:36:49 GMT Client-Peer: 127.0.0.1:5000 Client-Response-Num: 1

    no error on the log.Its just that everything works except the image.

    unlikely

    is there any work around if apache wont server images ?

    Either don't keep images in cgi-bin, or configure apache to serve images from cgi-bin (I'm assuming its possible).

      Havent kept my image file in cgi-bin.I put it just outside cgi-bin dir.Doesnt work still. Also some suggestions on what parameter is required for $cgi->img(-src=> ?

        Forget CGI for the moment, access the image via a browser via http://localhost not file://. If, as others have pointed out, you still claim that your error_log isn't displaying "File does not exist: /blah/blah/image.png" style errors your apache config is wrong.