Current time: 11-05-2024, 07:34 AM Hello There, Guest! (LoginRegister)


Post Reply 
PHP File Permission Denied
Author Message
kilburn Offline
Development Team
*****
Dev Team

Posts: 2,182
Joined: Feb 2007
Reputation: 34
Post: #11
RE: PHP File Permission Denied
file owner should be vuXXXX, not www-data...
09-19-2009 10:37 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Diego Offline
Junior Member
*

Posts: 30
Joined: Sep 2009
Reputation: 0
Post: #12
RE: PHP File Permission Denied
(09-19-2009 10:37 AM)kilburn Wrote:  file owner should be vuXXXX, not www-data...
Worked!! Big Grin
Thank you! +Rep
09-19-2009 11:06 AM
Find all posts by this user Quote this message in a reply
theprincy Offline
Member
***

Posts: 311
Joined: Nov 2008
Reputation: 2
Post: #13
RE: PHP File Permission Denied
(09-18-2009 05:18 PM)joximu Wrote:  no - php files do not need the execute flag.

you can write a script which sets the correct permissions and owners:
eg:
Code:
!/bin/bash

username=$(ls -ld . | cut -d" " -f3)
echo "Set to user/group: $username/$username"
echo "Cancel -> Ctrl-C, otherwise press Enter..."

read

# set owner vu:vu - folders
cmd="find ./ -type d -exec chown $username:$username {} ;"
#echo $cmd
($cmd)

# set owner vu:vu - files
cmd="find ./ -type f -exec chown $username:$username {} ;"
#echo $cmd
($cmd)

# set permissions - folders
cmd="find ./ -type d -exec chmod 0755 {} ;"
#echo $cmd
($cmd)

# set permissions - files
cmd="find ./ -type f -exec chmod 0644 {} ;"
#echo $cmd
($cmd)

# php files: less permissions (do not need to be world readable)
cmd="find ./ -type f -regex .*\.php$ -exec chmod 0640 {} ;"
#echo $cmd
($cmd)

echo "finished..."
echo ""

run the script inside the htdocs folder (but the htdocs folder must have correct ownership!!! - the script get's the owner of the currect folder!)

/J


Why not also include in the panel as a utility for users?
09-19-2009 02:55 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Diego Offline
Junior Member
*

Posts: 30
Joined: Sep 2009
Reputation: 0
Post: #14
RE: PHP File Permission Denied
The file permissions is set to vu2001/vu2002 when you create the user, but if you extract something using root, the permissions will be set to root instead of vu2001..
this is what happened with me..
09-19-2009 08:55 PM
Find all posts by this user Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 2 Guest(s)