www-data用户无法写入fifo,chmodded 777

I wrote a little PHP script that I'd like to call from Apache. I'm intending to use this to control pianobar.

If I execute the script directly from a root terminal, it works just fine, but if I try to run the script through the web server, nothing.

The fifo I created is at /home/dave/.config/pianobar/piano and the relevant lines in the PHP script look like this...

<?php
system("echo -n 'p' > /home/dave/.config/pianobar/piano"); //'p' pauses pianobar.

echo system('whoami');
?>

If I execute this script in a browser through Apache, it echoes 'www-data www-data' which tells me that safe mode is disabled and the system() command is working, but pianobar keeps playing. If I run this from a root terminal, it echoes back 'root' and pianobar pauses. If I execute this from a terminal under my own username, it echoes back 'dave' and pianobar still pauses.

The fifo I created /home/dave/.config/pianobar/piano was chmodded to 777. What gives? Is this a permissions issue somehow? Is PHP not allowing me to do anything useful with the system() command?

Check folder permissions:

stat --format '%a' /home/dave/.config/pianobar/piano

Set folder permissions for all files inside of folder:

sudo chmod -R 755 /home/dave/.config/pianobar/piano

Try, should work.