ispCP - Board - Support
PHP File Permission Denied - Printable Version

+- ispCP - Board - Support (http://www.isp-control.net/forum)
+-- Forum: ispCP Omega Support Area (/forum-30.html)
+--- Forum: Usage (/forum-34.html)
+--- Thread: PHP File Permission Denied (/thread-7886.html)

Pages: 1 2


RE: PHP File Permission Denied - kilburn - 09-19-2009 10:37 AM

file owner should be vuXXXX, not www-data...


RE: PHP File Permission Denied - Diego - 09-19-2009 11:06 AM

(09-19-2009 10:37 AM)kilburn Wrote:  file owner should be vuXXXX, not www-data...
Worked!! Big Grin
Thank you! +Rep


RE: PHP File Permission Denied - theprincy - 09-19-2009 02:55 PM

(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?


RE: PHP File Permission Denied - Diego - 09-19-2009 08:55 PM

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..