You are here: Re: directory permissions « PHP Programming Language « IT news, forums, messages
Re: directory permissions

Posted by Gordon Burditt on 11/23/06 19:43

>> >> >How does one set directory permissions in PHP? The manual only refers
>> >> >to chmod function changing permissions for files. I try to use it for
>> >> >directories but it didn't work.
>> >>
>> >> In what way did it not work? Because that's the correct function to use.
>> >>
>>
>> >Here is the statement I am running
>> >chmod(./directoryname/, 0777)
>>
>> What is the owner of the directory?
>> What user is the PHP process running as (e.g. 'apache', 'daemon', 'www', etc)?
>>
>> If these don't match, you can't change the permissions because the OS
>> won't let PHP do it.
>
>The directory is under apache web root directory.

AND WHAT USER OWNS IT? (Hint: under UNIX, "ls -ld" will tell you this.
Under PHP, the stat() or fileowner() function will give the numeric user id,
and the posix_getpwnam() function will translate that to a name.)

>Its currently set to
>755. I am running PHP under apache.

AS WHAT USER?
(Hint: under UNIX, various forms of ps will give the user name running
the 'httpd' or 'apache' process. )

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация