I was using AXS for my stats but I'm having trouble getting it to work with php.

I get this error:

Code:
<br>
<b>Warning</b>:  fopen("log.txt","a") - Permission denied in <b>/home/literatu/public_html/axs/ax.php3</b> on line <b>42</b><br>
<br>
<b>Warning</b>:  Supplied argument is not a valid File-Handle resource in <b>/home/literatu/public_html/axs/ax.php3</b> on line <b>43</b><br>
<br>
<b>Warning</b>:  Supplied argument is not a valid File-Handle resource in <b>/home/literatu/public_html/axs/ax.php3</b> on line <b>44</b><br>
<br>
<b>Warning</b>:  Supplied argument is not a valid File-Handle resource in <b>/home/literatu/public_html/axs/ax.php3</b> on line <b>45</b><br>
<br>
<b>Warning</b>:  Supplied argument is not a valid File-Handle resource in <b>/home/literatu/public_html/axs/ax.php3</b> on line <b>46</b><br>
And the permissions are 777, so I don't understand that. ax.php3 is here:

Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=windows-1252"></HEAD>
<BODY><XMP><?php

#########################################################
# PHP3 AXS Script Set, Logging Module					#
# by Oxydius, PC Alpha (http://www.pcalpha.com)			#
# oxydius@pcalpha.com									#
#														#
# Include this script from a PHP page using:			#
# include ("/full_filesystem_path_to/ax.php3");			#
# or													#
# virtual ("/virtual_server_path_to/ax.php3");			#
#														#
# Configure the variables below							#
#########################################################

$LogFile = 'log.txt';
$TimeOffsetInHours = +1;

#########################################################

$domain = 'http://'.xxxxx.net';
$To = $domain.$REQUEST_URI;
$From = $HTTP_REFERER;
$REMOTE_HOST = getHostByAddr($REMOTE_ADDR);

$unixtime = time() + (3600*$TimeOffsetInHours);

$second = date("s", ($unixtime))+0;
$minute = date("i", ($unixtime))+0;
$hour = date("G", ($unixtime))+0;
$day = date("j", ($unixtime))+0;
$month = date("n", ($unixtime))-1;
$year = date("y", ($unixtime))+100;
$wday = date("w", ($unixtime))+0;
$yday = date("z", ($unixtime))+0;

$logline = "|$REMOTE_HOST|$REMOTE_ADDR|$From|$To|$HTTP_USER_AGENT|$second|$minute|$hour|$day|$month|$year|$wday|$yday|\n";

$file = fopen("$LogFile", "a");
flock($file, 2);
fwrite($file, "$logline");
flock($file, 3);
fclose($file); 

?></XMP></BODY></HTML>

If anyone knows whats wrong that'd be great, if not then does anyone know a good PHP tracking script?

Chris