Re: Permission Denied - Help Requested

From: Date: Wed, 30 Mar 2011 00:21:10 +0000
Subject: Re: Permission Denied - Help Requested
References: 1 2 3 4 5 6  Groups: php.general 
Request: Send a blank email to php-general+get-312135@lists.php.net to get a copy of this message
At 05:33 PM 3/29/2011, Adam Richardson wrote:
Thanks. What do you see if you run this? "Can't open or create file!" Ethan OK, If you're running PHP as an Apache module, by default it won't have permissions to write to the directory (this is by design to avoid security issues.) You can do something like the following: 1. Create a directory for writing files outside of your public directory (let's call it "uploads".) 2. Change the group associated with the directory to Apache: sudo chgrp -R www-data /home/username/path/to/uploads 3. Change the permissions on the directory so the group has write permissions: sudo chmod -R 2775 /home/username/path/to/uploads 4. Then try the script again. See if that works. Adam -- Nephtali: A simple, flexible, fast, and security-focused PHP framework http://nephtaliproject.com ++++++++++++
Thanks - The directory is output_files, which is a subdirectory of /var/www I'm getting a message "invalid owner" on the command "chown Apache output_files". Also with the -R option, and with apache as the owner, also with the chgrp. All these commands are run as root.. Help and advice please. Ethan

« previous php.general (#312135) next »