Can't create symlink with ssh2_sftp_symlink

让人想犯罪 __ 提交于 2020-01-06 05:41:07

问题


I'm trying to create a symlink with ssh2 but it's fails.

The directory has been created (/home/test/) but the symlink doesn't.

Can I debug why the symlink fails?

$connection = ssh2_connect('localhost', 22);
ssh2_auth_password($connection, 'user', 'pass');
$sftp = ssh2_sftp($connection);

$result = ssh2_sftp_mkdir($sftp, '/home/test');
var_dump($result);
$result1 = ssh2_sftp_symlink($sftp, '/home/csgo/*', '/home/test');
var_dump($result1);

I'm tried with var_dump and got the following: bool(true) bool(false) so the directory is returned true and the symlink is returned false but I don't know why.

来源:https://stackoverflow.com/questions/58828162/cant-create-symlink-with-ssh2-sftp-symlink

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!