I currently have a PI3 on my home network. With my LAMP apache, I keep the www folder on the USB drive - let's call it /media/USB32/www
.
Oh- the USB partition is formatted as FAT32.
Assume my user id
is Tony
. I have added this user-id
to group www-data
.
I can access the www
folder for editing from a Windows PC, and I can read and write on it using puTTY
.
Apache can show a webpage on it, but Apache cannot write or update a file on it via a HTML Form using Fopen or Fwrite.
I'm pretty sure my PHP below is correct.-
function customError($errno, $errstr) {
echo "<br/><b>Error!:</b> [$errno] $errstr";
}
set_error_handler("customError"); //set error handler
echo "HERE GOES OPEN, WRITE and CLOSE";
$fp = fopen('dddata.txt', 'w+');
fwrite($fp, 'Our WRITE data...');
fwrite($fp, 'Some more crap.....');
fclose($fp);
.........
The error given is
fwrite() expects parameter 1 to be resource, boolean given
Any idea where my error(s) are?
</div>