Document created 15 Jul 02. Last update 19 Aug 02.
Thank you for downloading PHPCounter 5.1!
PHPCounter is a PHP script that tracks the number of visitors to a website. It has several options, like tracking each page individually and creating a log file in the Common Log Format (CLF). You can view a full list of features below.
To use PHPCounter, you do not need a database. Everything is stored in text files, and you can view the tracking results in real time.
As of version 5.1 of PHPCounter, the following features are implemented:
To see which of the features are the new ones, then take a look at the changelog.txt file.
You have to decide which of these features you want to use. Remember that the more features you use, the slower PHPCounter will be, and therefore, the slower your website will be. You have to test how much each feature affects the speed of loading for your pages.
The Common Log Format is a standard file format for Apache web servers that contains the tracking data. There are several programs that allow you to analyse this data further.
NB: The following installation instructions are for version 5.1 of PHPCounter. They may seem long, but that is because they try to explain every step in great detail; the actual steps are simple :)
The installation is in two phases: Firstly you have to edit your files locally and then secondly, you have to upload them to your web space.
Once you have done the above, you have completed configuring PHPCounter. Now you need to upload it to your web space. To do that, create the directory that is your COUNTER directory as you decided earlier and upload all of the files there. Also create a directory within the COUNTER directory called 'locks' (no quotes). Once you have done that, you need to finish off by doing the following:
CHMOD is a function that allows you to change the permissions for a file or directory. Where this function is depends on the software, but usually it is in the right-click menu, or in a menu somewhere. You MUST change the permissions as stated or PHPCounter will not work!
Now you are done installing PHPCounter! To use it, see the Tracking Pages section below.
If you are upgrading from an earlier version of PHPCounter, then you need to do is to only upload all of the new files of PHPCounter into the directory where the old PHPCounter resides. However, before you do that, do not forget to edit settings.php and phpcounter.php as is explained above. Also CHMOD the new locks directory to 777, and also if you over-wrote the old clf.log and all.php files, you need to CHMOD them to 777 too. All pages would now start using the new PHPCounter script.
To track a page, make sure it is a PHP page - i.e., your server recognises it as a PHP file. This is almost always done by changing the file extension to php.
Now you need to insert a single line of code that will get PHPCounter to track the webpage. The line is as follows:
Note that you have to put this line within the PHP code delimiters, which are <?php and ?>. So you may have to add
the following code:
Also note that, you can put this line of code anywhere you want the counter to be. If the counter is invisible, this does not matter much, but if the counter is visible, then place this code where you want the counter to show up on the page.
To view the records of the hits for the website, point your browser to your COUNTER directory. So, if your COUNTER directory is '/usr/bloggs/html/counter/' and your website is eKstreme.com, then point your browser to http://ekstreme.com/counter/. You will get a nicely-formatted list.
Note: The tracking files will become VERY large with time; quickly if you have a popular site! You as the webmaster will need to maintain the tracking files. If the files get too large then your website will seem to stop working, timing out constantly. At which size this happens is variable, but if one of your log files if about 1MB in size, then you need to start thinking about cleaning up. To do this, you download all the hits files (they are an important record after all!), and then upload a fresh all.php and clf.log files. This will re-set the counter to 0.
If after following the instructions PHPCounter still does not work, then please read the latest version of the PHPCounter FAQ found on eKstreme.com. If it is still broken, then please contact me using this form.
If you have any suggestions, tips, ideas, questions or comments relating to PHPCounter, then please don't hesitate to contact me using this form. Suggestions from users are what drives the development of PHPCounter, so send them in! Thank you.
PHPCounter is freeware for personal and non-commercial users. All other users please contact me with details.
Use PHPCounter at your own risk. I make no garantees or warrantees of any sort. Do not blame me for anything that goes wrong.
Firstly, thanks to the users who use PHPCounter! Also thanks to all those who sent in suggestions and tips. Great thanks thanks go to the numerous beta testers who made PHPCounter much better than it would have been!