After some great help on sed'ing out files names from a setup file, I'm having trouble getting a bash script to run from apache via php shell_exec.
Basically it's just a loop to itself and runs a bash script that does all the work.
I've got a bashscript, creates qr barcodes and prints success back, that does work when called from terminal and handed a file name.
When it's executed from the shell_exec, it gives the proper return and that displays correctly on the browser but the file output doesn't happen.
How can that be? Its has to step all the way through to return success and print it back to the browser but not put out files.
Code:
<?php
$filename=$_POST['Filename'];
print "<form action='qrthermalimages.php' method='post'>";
print " <input type='text' name='Filename' value='' size='20' ><br>";^M
print " <input type='submit' name='PageAction' value='Process'>";
$ot = shell_exec ("./qrimager '$filename'");
echo $ot;
$ot = ''
?>
Running "ID" in the bash displays "apache" user and from terminal it's showing root.
It looks like apache cant write to a windows share in this instance but in one folder over I have nearly the same thing and it is able to write to the same share directories.