Problem with SSH output when called from apache
| From: | Chandu Nannapaneni | Date: | Tue, 07 Sep 2004 00:16:57 +0000 |
| Subject: | Problem with SSH output when called from apache | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-196000@lists.php.net to get a copy of this message | ||
Hi everyone !!
I want to capture the output of a certain remote command ( issued
thru a SSH session to a remote server) in PHP.
The following code is working well when ran from the console
Ex: php -q test.php
<?
passthru("/usr/bin/ssh -v -i /var/wwwhtml/sshtest/id_rsa
test@remotemachine uptime");
?>
But when called from apache .. It's not giving any ouput.
test@remotemachine is well configured for ssh without passphrase
I've checked the file permissions of /var/wwwhtml/sshtest/id_rsa
It's given read permissions for the user 'apache' ( apache is running
as apache:apache )
Any hints ???
/Chandu