You are here: Re: fopen() Permission denied « PHP Programming Language « IT news, forums, messages
Re: fopen() Permission denied

Posted by Lee C. Haas on 02/18/06 20:44

On 17 Feb 2006 13:48:32 -0800, "Alex" <spamgrind@gmail.com> wrote:

>You should allow your public_html directory to be searchable by all.
>chmod 755 public_html.
>...
>Alex

Thanks Alex and "samudasu," changing permissions was the key.

I had to change
lhcount.data to 766
public_html directory to 750

I don't understand why it didn't have to be 755 (which also worked)
and I don't understand why index.php worked with permissions 644.
index.php has the php code in it and I would have thought it would
need "execute" permission.
Is this explained clearly somewhere?

Following I is the complete php script I am using for a simple text
counter.

<SPAN style="float : right; color : #999999;">
<?php
/* The file lhcount.data with an initial number must be created in
the same directory as the file with this script */
$fh = fopen('lhcount.data','r+');
$Count=fgets($fh,64);
rewind($fh);
fwrite ($fh, ++$Count);
fclose ($fh);
echo($Count);
?>
</SPAN>

Thanks for the help.
Lee Haas, Raleigh, NC
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
Email may be sent to me by using:
http://tinyurl.com/fylz

 

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

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