You are here: Re: PHP fails writing to text file? « PHP Programming Language « IT news, forums, messages
Re: PHP fails writing to text file?

Posted by Jerry Stuckle on 09/29/27 12:00

Gilles Ganault wrote:
> On Tue, 15 Jan 2008 05:12:57 +0100, Gilles Ganault <nospam@nospam.com>
> wrote:
>> What am I doing wrong? Is it some kind of security feature in Apache
>> or the OS that's preventing the script from writing the text file?
>
> Found what it was:
>
> =======
> # ll
> drwxr-xrwx 2 root wheel 512 Jan 15 05:20 .
>
> # chmod 757 ./.
> =======
>
> Now, index.php can write into Apache's htdocs/ but I doubt this is the
> right solution. Does it mean that PHP scripts shouldn't write any file
> into htdocs/ ?
>
> Thanks.
>

Well, it's not necessarily a good idea - it's too easy to upload
malicious scripts. But with proper controls, it is possible.

chmod 757 will work, but as you found, is dangerous. Safer would be to
make the Apache user the owner of the directory, or at least a member of
the group which owns the directory.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

 

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

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