I have a script which creates a Directory to contain CSV files from a MySql database and the related .csv data files. I want to access the directory and use the .csv files to write reports with LibreOffice. If I run the following code snippet below , contained in the script, FROM THE COMMAND LINE the user:group is rick:www-data and all is ok as I can now run the new .CSV file in LibreOffice.
If I run the following code snippet below, contained in the script, FROM THE BROWSER the user:group is www-date:www-data and all is NOT ok as I CANNOT now run the new .CSV file in LibreOffice.
How can I change the owner:group of the Directory to rick:www-data.
Apparently the command line uses HOST owner while browser uses PHP owner ???
Please help with a simplistic answer. I have been two days looking at many ways to manipulate permissions, most of which is overly complicated(to me).
If I run the following code snippet below, contained in the script, FROM THE BROWSER the user:group is www-date:www-data and all is NOT ok as I CANNOT now run the new .CSV file in LibreOffice.
How can I change the owner:group of the Directory to rick:www-data.
Apparently the command line uses HOST owner while browser uses PHP owner ???
Please help with a simplistic answer. I have been two days looking at many ways to manipulate permissions, most of which is overly complicated(to me).
Code:
$dir="/home/rick/DBases/Dbmysql/contacts2/reports/";
if(!is_dir($dir)) {
mkdir($dir);
exec("chmod 766 $dir");
exec("chown -R rick $dir");
}
$filename=$dir.$csvExt;
echo $filename."\n\n";
bye(25);