Please find the php script attached. Extract it to your www directory.
The script assumes that you have the following packages installed:
php-thttpd (see macsat.com for details)
madplay
procps
Change the following files such that they refer to the appropriate locations on your filesystem:
globals.php (change all variables if necessary)
play (change PLAYLISTFILE, PIDFILE, NRFILE if necessary)
play.wrapper (change /opt/share/www/play if necessary)
You can leave: PLAYLISTFILE/$playlistfile, PIDFILE/$pidfile and NRFILE/$playnrfile unchanged (they refer to temporary files). If you change them, make sure you change them, such that each pair refers to the same file.
$playscript must refer to the play.wrapper script
$mp3dir must refer to the directory where you keep your mp3's
/opt/share/www/play must refer to the play script.
Watch the permissions of the user as whom the thttpd executes php. This user needs read/write permission to store temporary files, execute permission to execute shell commands as required and read permission in your mp3 directory. I solved this problem by setting the user to admin . To this end, change in /opt/share/thttpd.conf:
user=admin
Let me know if it works for you.