Some updates:
The following PHP script appears to not fully execute...
php:
<?php
//Connect to a Windows share and download a file.
$results = shell_exec("smbclient //192.168.206.1/d$ -U me mypasswd ; get test.txt /home/me/test.txt ; quit");
print_r($results);
echo "<div>$results</div>";
?>
...I checked the Windows logs and the script is connecting then immediately disconnecting and not transferring text.txt. I think "; get test.txt /home/me/test.txt ; quit" is not being executed. Why?
I can however issue the smbclient commands manually at the command line, one command at a time, and successfully transfer test.txt.
So next I figured I'd try writing a shell script then executing the shell script in PHP...
Contents of shell script:
#!/bin/bash
#Test script
smbclient //192.168.206.1/d$ -U me mypasswd && get test.txt /home/me/test.txt && quit
Contents of php script:
php:
<?php
//Connect to a Windows share and download a file.
$results = shell_exec("sh shell");
print_r($results);
echo "<div>$results</div>";
?>
...I checked the Windows logs and the script is connecting then immediately disconnecting and not transferring text.txt. Again, I think "&& get test.txt /home/me/test.txt && quit" is not being executed. Why?
Thanks,
Nick