I'm attempting to automate a home music system, I've got most of it working. All is working brilliantly thus far, however...
I've started seeing this:
[Sun Sep 08 17:19:54 2013] [error] [client 192.168.1.15] PHP Warning: dir(/media/BUDrive/Document_Backups/Mp3s/faith no more): failed to open dir: Permission denied in /var/www/detect.php on line 124
This is part of the webservice I've got running. I've given apache full root access (as it's hosted on a local lan, not available to the outside world). I've also added www-data to the pi group. Yet, this still happens.
The /media/BUDrive/ is a mounted external hdd. All running lovely with samba and accessible via DLNA also.
What am I missing? How can I let this php script to access the external file system?
Edit (More info):
Excert from ls from command line of the mounted drive:
pi@rpi ~ $ ls /media/BUDrive/Document_Backups/Mp3s/
Alice Cooper
Alice In Chains
Alien Ant Farm
Alkaline Trio
All That Remains
Andy McKee
A Perfect Circle
August Burns Red
Avenged Sevenfold
balkan beat box
Bare Naked Ladies
Biffy Clyro
Blind Melon
Bloodhound Gang
Bullet For My Valentine
Clawfinger
Clutch
The function that attempts to find the directory:
function processMusicAgain($s)
{
$parentdir = "/media/BUDrive/Document_Backups/Mp3s";
$d = dir($parentdir."/".$s);
if(!$d)
{
echo "I'm sorry, I can't find anything by ".$s;
}
else
{
$d->close();
}
}
All I get is the "I'm sorry, I can't find anything by ...".
This is regardless of spaces in folder names or not. I've tried all of them and it never finds anything, only writes the above error to apache error_log.