Friday, May 3, 2024
 Popular · Latest · Hot · Upcoming
1
rated 0 times [  1] [ 0]  / answers: 1 / hits: 15157  / 2 Years ago, mon, july 25, 2022, 3:41:32

I am new to Ubuntu and recently I installed xampp 1.8.1 on my Ubuntu 12.10. My problem is that 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 shows some link and no image.


But when I use the following


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

images are shown after 'Unsung heroes' text.


It works well on Windows platform.


As a new user, I have very little knowledge about file permissions, chmod, chown etc. I use ls -l in my terminal window in /opt/lampp/htdocs/madeTemplet/basicTemplet/_images directory, and I see this:


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

I also go to


/opt/lampp/etc/httpd.config

to find EnableMMAP off and EnableSendfile off which is already # off.


How to solve this problem?


More From » permissions

 Answers
2

I can see your files with read write permissions JUST for the owner but not to the group or other (world universe).


Try the next in a terminal:


sudo chmod 775 -R /opt/lampp/htdocs/madeTemplet/basicTemplet/_images

This will provide read permissions for the world universe of users, this way you will be able to see the files without problem when browsing in a localhost environment or the net.


The reason because of the files and images are properly shown when you run file:///opt/lampp/htdocs/madeTemplet/basicTemplet/templet03.html is because of the owner of the files is allowed to read/write over them. But the rest of the people won't be able to reach certain files that won't meet the requirements for worldwide access.


Additionally, you may need to assign anonymous read permissions to the folder where the files resides by running sudo chmod 775 /opt/lampp/htdocs/madeTemplet/basicTemplet/_images -R


-R = Recursively: All the files/folders inside will also be affected.


Please give this a try and let us know if this is doing the work for you, if you need further assistance don't hesitate to let us know by dropping a message and the contents of this answer may be changed or deleted depending on your results.


Good luck!


[#31627] Wednesday, July 27, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
rillrage

Total Points: 122
Total Questions: 120
Total Answers: 103

Location: Tokelau
Member since Thu, Aug 26, 2021
3 Years ago
rillrage questions
;