neonpolaris
March 26th, 2009, 04:23 PM
Hey guys. I'm trying to make a very simple web-controlled jukebox of sorts. I've got Ubuntu 8.10 Desktop running Apache2, PHP5, MySQL, and phpmyadmin all successfully. I've found a command-line mp3 player, mpg123, which seems right for the job. It's installed, and it works. But I've been unsuccessful in getting the web interface to start the program locally.
I've given www-data permission to directly access to the sound device. I've made a simple php page trying to run 'mpg123 go.mp3'. I've specified the directories of the program, even copied it to the www folder with the page. The page does load with no errors, but nothing seems to happen. I've tried with exec, passthru, and system, but I'm a bit lost.
I've seen some php jukebox software around, but most of them are about streaming to the remote computer, which is not what I want. The others are too convoluted and feature-rich for me to find what routine actually plays the file.
Also, if I run the PHP from the command line:
php -r "exec('mpg123 go.mp3');"
It works.
Has anyone else done something like this?
I've given www-data permission to directly access to the sound device. I've made a simple php page trying to run 'mpg123 go.mp3'. I've specified the directories of the program, even copied it to the www folder with the page. The page does load with no errors, but nothing seems to happen. I've tried with exec, passthru, and system, but I'm a bit lost.
I've seen some php jukebox software around, but most of them are about streaming to the remote computer, which is not what I want. The others are too convoluted and feature-rich for me to find what routine actually plays the file.
Also, if I run the PHP from the command line:
php -r "exec('mpg123 go.mp3');"
It works.
Has anyone else done something like this?