Linux/PHP question

Myrle A. Francis mafmanet-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org
Tue Nov 4 07:54:45 EST 2008


To clarify not working: 

My hitcounter.txt file contains the value of one.  After i execute my php script that is supposed to incriment the value of the text file from 1 to 2 still contains the value of 1

Thanks 

-----Original Message-----
From: John Abreau <abreauj-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org>
Sent: Monday, November 03, 2008 8:54 PM
To: Myrle Francis <mafmanet-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org>
Cc: Discuss-mNDKBlG2WHs at public.gmane.org
Subject: Re: Linux/PHP question

It's hard to tell without any information of what "not working" means.

One obvious problem is that you don't allow for the possibility
that two or more instances could try to update the counter file
at the same time.

 Let's say you get 10 hits at roughly the same time, such that
all 10 read the file before any of them write to the file. The last
one to write the file increments the count by 1, and so the count
only goes up by 1 even though there were actually 10 hits.





On Mon, Nov 3, 2008 at 2:53 PM, Myrle Francis <mafmanet-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org> wrote:
> HI,
>
>  I created a simple counter for my website and it doesn't seem to be
> working. I copied it from a windows/apache installation on my local windows
> machine and it works there (just not on linux)
>
> The file that contains the hit count hitcount.txt has the attributeof rw-
> rw- rw.
>
> The program itself counter.php has the attribute of rwx r-x r-x


[The entire original message is not included]






More information about the Discuss mailing list