Unfortunately Apache logs does not show anything useful, this is also driving me crazy
.
I see only it records the call from browser:
[03/Jun/2019:19:46:54 +0300] "GET /netatmo/sound.php HTTP/1.1" 200 205 "-" "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Firefox/60.0"
This is the first time I try to make the sound to work on this little Raspberry Pi server.
The webserver itself is functional, other pages, which does not involve sounds, works.
Now I tried another approach:
1. started mplayer in slave mode attached to a FIFO:
mplayer -slave -idle -input file=$FIFO_CONTAINER
2. Adding php script just the command to add a mp3 file to this FIFO:
<?php
$command = "echo loadfile /var/www/html/sound.mp3 > /tmp/fifo1";
exec($command);
?>
3. if I execute this php from command line in terminal:
sudo -u www-data php sound.php ===> this WORKS fine, sound is generated
4. but if I launch PHP from webpage there is no sound, and not sure where it might be the trick.
FIFO file has all needed permissions.