Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6027641
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T04:37:20+00:00 2026-05-23T04:37:20+00:00

So I have a question for you guys… I am trying to write a

  • 0

So I have a question for you guys… I am trying to write a web site in PHP that will allow people to upload images to my server. I have the upload part working, so that’s not the issue. The issue is when I try and write the uploaded files to a directory outside of apache’s document root.

Apache’s document root is /var/www/, and the directory I am trying to save these images to is /mnt/storage/images/. I have created the directory, changed the group to www-data, and changed the permissions on the directory to 777 (even though I know that’s horrible security wise). I tried a few things with the apache configuration file, /etc/apache2/apache2.conf, namely adding a tag and an Alias line, but nothing seems to work. Every time I try and upload a file to the images directory, it gives me a permission error. I’ve even tried putting a few files there manually and navigating to the directory, using the alias, with the web browser, and I get a 403 error.

I know I am either doing something wrong, or I haven’t done something to make this work. I have googled around for help on this for a few days now, and all I find is useless information, or bits and pieces of information that barely help at all.

Btw… I’m on Ubuntu 11.04 using Apache 2.2.17, and I have root access and all that jazz.

Thanks,
Robbie

EDIT: Here is the part of the apache config that I put in:

Alias /images "/mnt/storage/images/"
<Directory "/mnt/storage/images/">
    Allow from all
</Directory>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T04:37:21+00:00Added an answer on May 23, 2026 at 4:37 am

    You have to grant Apache access permissions on ALL of the directories involved:

    /mnt
    /mnt/storage
    /mnt/storage/images
    

    There’s no point in doing 777 on images if Apache has no rights on the storage or mnt directories.

    Of course, only images would need to have write permissions, as that’s where you’re actually doing file operations. mnt and storage would need at most read permissions, and you can get away from doing global (xx7) permissions by putting Apache’s user account into a group and chgrp the images directory to that new group.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey guys quick question, I have an add remove script that will add a
guys! I have follow question. I am writing an application that will track movement
Hi guys I have a weird question, I have a cli php script runs
Hey guys I have one more question lol. I am using a script that
Hey guys quick question, I have an entry that I put in my database,
Hey guys quick question. I have a div that gets assigned a number to
Hey guys I have a quick question, I have a dialog box that has
All right real quick question guys. I know that C# Forms have the OnPaint()
I have a question that i hope you guys can help me with! This
Okay, I have a question guys. I want to remote upload (copy an image

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.