File and Directory Ownership Question

File and Directory Ownership Question

am 20.12.2009 18:58:50 von Al

I've got a PHP script running on a shared host [Blue Host] that creates a
directory and writes files in it.

The directory and files are "owned" by the site name, not "nobody" as I've
always seen on other shared hosts.

Anyone have a possible explanation for this?

Thanks, Al.........

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: File and Directory Ownership Question

am 20.12.2009 19:06:34 von Ashley Sheridan

--=-MAtfFlcKj4vTgETGQ7Zi
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

On Sun, 2009-12-20 at 12:58 -0500, Al wrote:

> I've got a PHP script running on a shared host [Blue Host] that creates a
> directory and writes files in it.
>
> The directory and files are "owned" by the site name, not "nobody" as I've
> always seen on other shared hosts.
>
> Anyone have a possible explanation for this?
>
> Thanks, Al.........
>

The files, if created by PHP, will belong to the user and group that
your instance of Apache is running under. Some hosts are set up slightly
differently, but it's nothing to worry about.

Thanks,
Ash
http://www.ashleysheridan.co.uk



--=-MAtfFlcKj4vTgETGQ7Zi--

Re: File and Directory Ownership Question

am 20.12.2009 19:22:38 von Al

On 12/20/2009 1:06 PM, Ashley Sheridan wrote:
> On Sun, 2009-12-20 at 12:58 -0500, Al wrote:
>
>> I've got a PHP script running on a shared host [Blue Host] that creates a
>> directory and writes files in it.
>>
>> The directory and files are "owned" by the site name, not "nobody" as I've
>> always seen on other shared hosts.
>>
>> Anyone have a possible explanation for this?
>>
>> Thanks, Al.........
>>
>
> The files, if created by PHP, will belong to the user and group that
> your instance of Apache is running under. Some hosts are set up slightly
> differently, but it's nothing to worry about.
>
> Thanks,
> Ash
> http://www.ashleysheridan.co.uk
>
>
>

Thanks for the quick answer.

On purpose, to add a little security, I set the permissions for 644 to limit
access by anything other than PHP scripts.

I'd like to put my script above the web space; but it's generally used by folks
on shared hosts and some hosts won't provide access there.

I guess I'll add an htaccess file to my application's root that prevents access
by anything other than my scrip.

I've also found several cases, on some hosts, where the directories can be
indexed. So all the files are exposed. I've set config files, etc. with a php
extension to prevent them from easily being read.

Al........


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php