please help me,
i have a php script that invokes a bash script on a remote machine via ssh. both the machines have ssh access. when i invoke the php script from the browser it doesnt get executed but when i invoke that script from command line through php interpreter it works. i dont understand why it isnt working. please help
thax
SSHing from PHP code
Moderator: General Moderators
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
Re: SSHing from PHP code
i have tried both exec and system
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
Re: SSHing from PHP code
It sounds like your user account can run ssh, but the user under which the webserver runs does not. It may be that you just need to su to that account and ssh to the desired server so that ssh will create an entry for the target server.
(#10850)
Re: SSHing from PHP code [RESOLVED]
thanks, it WAS as you suggested, permission issue. ALL working
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Re: SSHing from PHP code
There are a bunch of SSH related functions by the way
You'll have to install the appropriate extension for them to work however.
http://au2.php.net/manual/en/book.ssh2.php
http://au2.php.net/manual/en/book.ssh2.php