hjgarza
By:
hjgarza

Why wont images on my website display.

September 11, 2014 2.1k views

Hello, I installed Apache on an Ubuntu server 14.04 and used FileZila to transfer files for my website. But, the images will not display. I have had this issue in the past and a buddy of me of a command that I need to enter but I cannot recall.

Has anyone had this issue before and was able to find a solution.

4 comments
  • probably ...maybe...you need to run (assuming your websites are in /var/www):

    sudo chown -R www-data:www-data /var/www

    what this does is change the permissions on the files you uploaded to be owned by www-data, which is the default user for apache.

    When you upload files, those files are owned by your user, so your www-data user does not have access.

  • do i then need to restart apache ?

  • "do i then need to restart apache ?"

    nope. that should do it. ..assuming that is the problem.

    It could be other things..like you uploaded the images to the wrong folder, or did not let the images finish uploading, etc.

  • this is what filezilla says is the remote site /var/www/html/MyOnlineStore
    MyOnlineStore is the folder where all my files are at...I tried just putting them individually in the www directory but when i entered the ip address for my machine it would not display them i am only able to access them when i have the myonline store directory within the html directory

    what is happening is that i am prompting a user to select a picture, that picture would then be displayed on the page below is the code for that

    <input type="file" name="fileField" id="fileField" />

1 Answer

this is what filezilla says is the remote site /var/www/html/MyOnlineStore
MyOnlineStore is the folder where all my files are at...I tried just putting them individually in the www directory but when i entered the ip address for my machine it would not display them i am only able to access them when i have the myonline store directory within the html directory

Have another answer? Share your knowledge.