file.php
Code:
<?php
exec('script.sh');
?>
script.sh
Code:
#!/bin/sh
/usr/bin/aplay /msc/share/attention.wav
# which aplay
/etc/apache2/apache.conf
Code:
# These need to be set in /etc/apache2/envvars
User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}
/etc/apache2/envvars
Code:
export APACHE_RUN_USER=www-data
export APACHE_RUN_GROUP=www-data
# groups www-data
Code:
www-data : www-data audio pulse pulse-access
Objective: Allow opening a webpage to play an audio file on the server, not on the client loading the page, but in order to make the server hosting system play an audio file. It is going to be a script opening the page, so the php script doesn't have reason to provide feedback or be more than a blank page, it's just means of executing a script to play audio on the server system.
Problem: I'm not sure what I am doing wrong here, or why this is not working, or if this is simply not possible. However, I am not able to get the audio file to play.
I'm open to suggestions of alternative methods of doing this same thing, but I have to do it over http, because it's the only means I have of making the client communicate with server.