Got my PI for xmas and I want to turn it into a web based music player.
As a test I run these commands: First, make sure it's using the 3.5mm jack:
sudo amixer cset numid=3 1
Then play the music:
sudo mpg123 /files/music/Martin_Garrix_Animals.mp3
Doing this directly into the console works.
If I try doing it via PHP
<?php //using either of these, tried with sudo before each command exec("mpg123 ../files/music/Martin_Garrix_Animals.mp3"); shell_exec("mpg123 ../files/music/Martin_Garrix_Animals.mp3"); ?>
I get nothing, I'm not sure if it's due to permissions?