Re: exec returns no output?
| From: | Colin Guthrie | Date: | Sat, 30 Sep 2006 17:41:41 +0000 |
| Subject: | Re: exec returns no output? | ||
| References: | 1 2 3 4 5 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-242431@lists.php.net to get a copy of this message | ||
Nick Wilson wrote:
> Right, im with you. The keyfile is mine though, and i know i can ssh
> from this box to that without any problem.
>
> I've made a test script for htis and it's returning some very weird
> stuff now. The actual file it outputs (stdout and stderr) is the actual
> image im trying to send!
>
> <?php
> $file = '/stat/data/drupal/image.png';
> exec("/usr/bin/scp -v -i /home/troot/.ssh/id_dsa $file
> nick@image.server.com:/var/www/images/ 1>&2
> /var/www/html/test/out", $ack);
> print_r($ack);
> ?>
Could it be a permissions problem? your ~/.ssh folder should has to be
nailed now permissions wise otherwise SSH will complain. Also the id_dsa
file is usually only readable by the user and nothing else (e.g. mode 0600)
I'd suggest you check permissions. Also I'd add a new key for this
rather than user your own. If the apache process can read your private
key this is quite a security risk....
Col.