For a simple php counter there's no need to use databases, flatfiles will do fine, the example by websaint is suffice as long as
<p>Number of guests visiting my site: <? include('alle.txt'); ?>.</p>
Is stored on the server and is not changeable or dependable on userinput.
Anyway, I was thinking that using an OOP approach here might be an overkill. What if you take the following PHP file
vc.php
<?php
$countfile = file("alle.txt");
$count = $countfile[0];
$count= $count + 1;
$fp = fopen("alle.txt","w");
$fw = fwrite($fp,$count);
fclose($fp);
echo $count;
}
?>
Basically you know that whenever vc.php is called there is a new page visit so which means that you need the variable $count back.
So all you need to do now in your other php files is to have them include("vc.php") in the code.
eg
index.php
<?php
echo("hi");
include("vc.php");
?>
This would be failsafe for any crosssitescripting attempts since there's no userinput expected. Also, even if the name of vc.php is known so people can call it directly, it doesn't matter since they could only +1 to your counter, which is also possible if they reload your page 20+ times. Also, people still need to know the name of the counter script, which is quite difficult to guess if they don't see it stated somewhere.
Alternatively, you could also add an ip banning system to this script to check if a user has accessed this site before. Which is not really necessary if you want to know how much your page has been loaded.
About the busy website thing, it'd take quite a lot of requests per second to be faster than the opening and writing of one byte in a single file for it to have a deadlock. Also, If one has a busy site that can accomplish such thing, it'd be wiser to use a database approach since you can generate more statistics than just the amount of page visits (which is only interesting with a lot of visitors).
Ps. Anything flash is bad