Wednesday, February 18, 2009

FireStats - Top 40 php script - guide


I have been using mt-daapd since I had the slug but I had some problems to make firestats work with it (Unfortunately, it does not have any installation procedure afaik...). If you do not know what firestats is maybe you should refer to this link. It is a very nice statistics utility for your mt-daapd server. Let us start with the guide how to make it work :)
First download the utility from here or here. Unzip the package to a directory under /var/www.
For example: /var/www/firestats

You need some packages to install if you have noe doen so...
apt-get install php5-common
apt-get install php5-sqlite

Almost done. The script is written for unslung I guess so we need to adjust some parameters. You need to change some of the lines in functons.php. I suppose your database is sqlite3 and the database file is "/var/cache/mt-daapd/songs3.db"
Open functions.php
nano /var/www/firestats/functions.php

Find the line

#$DSN="sqlite:/opt/var/mt-daapd/songs3.db";

uncomment it and change to
$DSN="sqlite:/var/cache/mt-daapd/songs3.db";

Also find the lines (total two lines)
$config['FIREFLY']['DSN'] = "sqlite:/opt/var/mt-daapd/songs3.db";

and change to
$config['FIREFLY']['DSN'] = "sqlite:/var/cache/mt-daapd/songs3.db";

The last thing to do, open the php.ini (/etc/php/apache/php.ini) file and add the lines below to the list of extensions.
extension=pdo.so
extension=sqlite.so

I guess you are done. Open your webbrowser and check if it works...
(This guide is for firestats ver. 1.28)

5 comments:

  1. Hi, it is possible that you can make the firestats.zip available for me, because the site above seems not to respond. And I have not found any other site which provides this file.

    Thanks,
    Markus

    ReplyDelete
  2. I put an alternative link for you :). Cheers

    ReplyDelete
  3. I cannot find the php.ini at
    /etc/php/apache/php.ini
    In my slug the path seems to be at
    /etc/php5/apache2/php.ini
    I added the two extensions but the Statistics tab would not appear. What can I do ?

    ReplyDelete
  4. It looks like
    /etc/php5/apache2/php.ini

    Just edit this file and add the linus under
    ;;;;;;;;;;;;;;;;;;;;;;
    ; Dynamic Extensions ;
    ;;;;;;;;;;;;;;;;;;;;;;

    It should be ok.

    You should find the file at
    http://your.address/firestats

    ReplyDelete
  5. Thanks for the quick reply. Still it is the same. I cannot see the statistics tab. The two files firestats.zip and forestats.tar are different. The .tar file has additional files (.dll and .ini). Do I need them ? When I go to http://your.address/firestats I get the file listings and when I run the firestats.php I get and error

    Warning: include(./summary.php) [function.include]: failed to open stream: Permission denied in /var/www/firestats/firefly.php on line 20

    Warning: include() [function.include]: Failed opening './summary.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/firestats/firefly.php on line 20

    ReplyDelete