Reply to Re: fopen - append works, write fails (but file is truncated)

Your name:

Reply:


Posted by Hans Fredrik Nordhaug on 07/28/07 05:23

On 2007-07-28, Jerry Stuckle wrote:
> Hans Fredrik Nordhaug wrote:
>> On 2007-07-27, davidkruger@techie.com wrote:
>>> On Jul 27, 12:19 pm, davidkru...@techie.com wrote:
>>>> On Jul 27, 12:00 pm, Hans Fredrik Nordhaug <han...@gmail.com> wrote:
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>> I'm trying to write to a file in the current directory - no remote
>>>>> files. The subject says it all - I can add that both the directory
>>>>> and the file is wordwritable. This happens on a (quite good) free
>>>>> hoster in Norway which doesn't use safe mode, running PHP 5.1.6 as the
>>>>> PHP info below shows ...
>>>>> Test it at:http://home.no.net/moldevbk/fopen-test/?mode=w(write- fails)http://home.no.net/moldevbk/fopen-test/?mode=a(append- ok)http://home.no.net/moldevbk/fopen-test/p.php-PHP infohttp://home.no.net/moldevbk/fopen-test/fopen-test.phps-source code of test script.
>>>>> I have searched the web and usenet, but not found this problem
>>>>> mentioned before. I do realize that I can work around the problem by
>>>>> truncating the file first and then appending to the empty file - but
>>>>> that is ugly as ...
>>>>> Regards, Hans
>>>>> --
>>>>> + It's GNU/Linux, not Linux ->http://www.gnu.org/gnu/linux-and-gnu.html
>>>>> + Support the Free Software Foundation ->http://member.fsf.org/
>>>>> + Become an Open Directory Project Editor ->http://dmoz.org/
>>>> Just curious if instead of sending fopen w for the mode using wb? I
>>>> am not sure if that will make any difference or not, but might make it
>>>> work.- Hide quoted text -
>>>>
>>>> - Show quoted text -
>>> If you set the permissions on the folder you are attempting to save to
>>> to chmod 707 you should be able to write the file.
>>
>> The folder is already set to 777 as the URL
>> http://home.no.net/moldevbk/fopen-test/ tells you. How setting it to
>> something more restrictive will help beats me. (I did test and it of
>> course made no difference.)
>>
>> Are you just suggesting all the standard answers in stead of reading
>> what I write? Thx for your time anyway.
>>
>> Hans
>
> You should set it to what's appropriate. Seldom is 777 appropriate, and
> PHP may disallow access to a file or directory so set up.

But this isn't case here - 777 (or really 707) is a appropriate since
the webserver user is "nobody" which isn't part of the group users.

Hans

[Back to original 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

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