Im currently trying to develop a system that can play audio files given a GET request in PHP. I also developed a simple script that relies on omxplayer to play a specific audio track, the main problem is if I try to get the audio to a bluetooth speaker using PHP it doesn't give me any sound (if i run the same script without "-o alsa" it works). The scripts just run
omxplayer -o alsa $1
The only times that this script doesn't work is in my PHP class after a GET request, the code is the same as above
echo shell_exec('./playTrack test.mp3');
If i try to execute the script on the shell it works with no issue
./playTrack test.mp3
Same if i try to run it from the shell using PHP
php -r "echo shell_exec('./playTrack test.mp3');"