I just created this for one of my client

Create A File Called counter.txt With CHMOD 777 In The Root Directory

$Visits = file_get_contents("counter.txt");
file_put_contents("counter.txt", $Visits++);

It works great like statcounter and other programs which also does not do much like unique ip tracking and other stuff.