Forum Moderators: coopster
I want to write a php script that will analyze my server logs and based on the contents create an html file.
I would like to access the log files by using something like:
$open = fopen("http://www.mydomain.com/logs/logxx.gz", "r");
The problem is that I don't know what is the absolute path to the file. In the ftp program I am using, the html files are in www/htdocs subdir. To get to logs I need to "back up" to www and then logs dir becomes visible (www/logs). My question is how does this map to the fopen directory in the scripting language, and do I need to set up any special permissions?
<?php phpinfo();?> Run the page and search for SCRIPT_FILENAME. Next to it, you will see the full path to your php file.
You'll probably have to hardcode a new directory path, but you should be able to point it straight into the logs folder.
As for your gzip question, a quick search of G didn't reveal anything promising...