So I've got a question for everyone... I'm attempting to write an internet site in PHP that will permit individuals to upload images to my server. I've the upload part working, so that isn't the problem. The problem happens when I attempt and write the submitted files to some directory outdoors of apache's document root.

Apache's document root is /var/www/, and also the directory I'm attempting to save these images to is /mnt/storage/images/. I've produced your directory, transformed the audience to www-data, and transformed the permissions around the directory to 777 (despite the fact that I understand that's horrible security smart). I attempted a couple of things using the apache configuration file, /etc/apache2/apache2.conf, namely adding a tag as well as an Alias line, but nothing appears to operate. Each time I attempt and upload personal files towards the images directory, it provides me with a permission error. I have even attempted placing a couple of files there by hand and moving towards the directory, while using alias, using the internet browser, and that i obtain a 403 error.

I understand I'm either doing a problem, or I've not done something to make this happen. I've researched around for help about this for any couple of days now, and all sorts of I've found is useless information, or odds and ends of knowledge that barely help whatsoever.

Btw... I am on Ubuntu 11.04 using Apache 2.2.17, and that i have root access and all sorts of that jazz.

Thanks, Robbie

EDIT: This is actually the area of the apache config which i place in:

Alias /images "/mnt/storage/images/"
<Directory "/mnt/storage/images/">
    Allow from all
</Directory>

You need to grant Apache access permissions on All the sites involved:

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

There is no reason for doing 777 on images if Apache doesn't have privileges around the storage or mnt sites.

Obviously, only images will have to have write permissions, as this is where you are really doing file procedures. mnt and storage would want for the most part read permissions, and you will escape from doing global (xx7) permissions by putting Apache's user account right into a group and chgrp the pictures directory to that particular new group.

You most likely have safe_mode enabled in PHP. Power it down.

It's most likely the open_basedir. You are able to turn this off and on for specific domain names... Try something like

<Directory /var/www/vhosts/domain.com/httpdocs>
        php_admin_flag engine on
        php_admin_value open_basedir none
</Directory>

(Info here)[http://forum.parallels.com/showthread.php?t=62750%22] if you work with Plesk. Or else you should hopefully have the ability to conform it as to the ever you're using