Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am using Ubuntu 12.10 and recently have installed xampp 1.8.1. My problem is: image from server can not be shown.

my code is ::

<div class="sideBlock unSung">
    <h4>Unsung heroes...</h4>
    <a href="#"> <img src="_images/1_full.jpg" alt="Midnight Run" width="99" height="135" /> </a>

    <a href="#"><img src="_images/2d7y3ki.jpg" alt="Wyatt Earp" width="99" height="135" /></a>
</div>

here, in my address bar I use

 http://localhost/madeTemplet/basicTemplet/templet03.html 

and I want to show image after "Unsung heroes" text but it only shown some link and not any image

But when I use the following

file:///opt/lampp/htdocs/madeTemplet/basicTemplet/templet03.html 

and images are shown after Unsung heroes text.

It works well in windows platform.

After checking the permissions to access the directory where images are, I get this text in my terminal window ::

  sabbir@sabbir-pc:/opt/lampp/htdocs/madeTemplet/basicTemplet/_images$ ls -l
  total 300
 -rw------- 1 sabbir sabbir 204067 Feb 24  2010 1_full.jpg
 -rw------- 1 sabbir sabbir  75789 Nov 13  2009 2d7y3ki.jpg
 -rw------- 1 sabbir sabbir  23692 Apr 21  2010 6AB32AE44600435B9DE0FB5EBA24A912.gif

As a new user I can't insert image so you can check the given link as follow :

 http://stackoverflow.com/questions/16178342/image-can-not-be-seen-in-htdocs-in-ubuntu-12-10
share|improve this question
    
Directory structure (ls -l, as Stef noted) of htdocs would be helpful. Also: Please do give screenshots rather than descriptions of visual phenomenons (in this case, the "some link and not ny image") Please edit any further info into your question itself. –  user98085 Apr 23 '13 at 21:45
    
I am using "ubuntu 12.10" and my browser is "mozilla firefox" –  sonnet Apr 23 '13 at 21:46
2  
Could be the case of faulty permissions, that is Apache does not have enough permissions to access the directory where images are? You can check this and post the output using ls -l to see who owns the directory. –  Stef K Apr 23 '13 at 21:48
    
It shows look like the following :: -rw------- 1 sabbir sabbir 204067 Feb 24 2010 1_full.jpg here 'sabbir' is my computer name –  sonnet Apr 23 '13 at 22:02
    
For full image you can check this link :: "stackoverflow.com/questions/16178342/…; –  sonnet Apr 23 '13 at 22:05

2 Answers 2

Two things are comming to mind, the first is permissions and the second false path to image.

You could try only for testing purposes to:

  • give ownership to Apache i.e: chown -R www-data:www-data where www-data the Apache user and group.

  • use hardcoded path to image i.e: <a href="#"> <img src="/opt/lampp/htdocs/madeTemplet/basicTemplet/_images/1_full.jpg"...

Hopefully you will be able to find the problem.

Rebember to revert the changes after testing acoordingly.

share|improve this answer

I think you have to change permission of your htdocs folder

you can try this::

  1)  sudo -s

  2)  give your password

  3)  sudo chmod 777 -R /opt/lampp/htdocs
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.