This isn't directly related to your problem, but could/will become a problem once you do get the script running: You need to be flocking your counter datafile while it's in use. Otherwise, what's to prevent two scripts from opening it at the same time if two vistors hit your page at roughly the same instant?
Also, why is your counter iterating through each digit of $data and printing it with a \n newline after each digit? The browser isn't going to render newlines unless you use the <br> tag.
And why is $number wrapped in { ... } brackets within your final print statement?