I am trying to connect via ssh from php, and send a file. When the machines are different, it works. When I connect to the same machine, it doesn't work.
$this->conn = ssh2_connect($this->ci['host'],$this->ci['ssh_port']);
ssh2_scp_send($this->conn,$ssh_source,$ssh_destination);
The connection $this->conn is valid in both cases. So is there any reasons why ssh2_scp_send() will not work when $this->conn connects to the same machine? When trying on the same machine I get: Warning: ssh2_scp_send(): Failure creating remote file: (null)