[ILUG] Permissions question

kae at verens.com kae at verens.com
Tue Jul 21 09:55:19 IST 2009


On 07/20/2009 09:24 PM, ollie at eillo.org wrote:
> Looks like this:
>
> --rw------- 1 www-data www-data  7925 2009-07-20 21:04 index.php
>
> Question 1: Does index.php need execute permissions? It seems to work. . .
>    

PHP scripts don't need execute scripts to run because you don't execute 
them. the web server interprets them.

Unless you're running them from the CLI, in which case, yes, you will 
need execute rights, unless you explicitly call the file like "php 
the_file.php" instead of "./the_file.php"
> I noted that hidden files are still owned by root:
>
> -rw-r--r--  1 root     root      730 2009-07-20 21:04 .htaccess
>
> Question 2: Should I leave it like this or change it to www-data?
>    

will they ever need to be edited by the web user? if not, you can leave 
them.

> Same for most folders in document root:
>
> drwxr-x---  5 eillo    psaserv  1,0K 2009-07-20 21:04 ../
>
> Question 3: Should I change their owner/group to www-data?
>    

again, if they don't need to be edited by the web user, then you can 
leave them.

kae



More information about the ILUG mailing list