0
我想使用SSH2提取ZIP文件,但我没有多少运气。如何使用ssh2提取压缩文件
我曾尝试这样的代码:
$connection = ssh2_connect("localhost", 22);
if(ssh2_auth_password($connection, "user", "pass"))
{
$unzip = "unzip /directory/to/file/file.zip";
ssh2_exec($connection,$unzip);
}
但它不会做任何事情。虽然,当我直接输入命令到终端/命令提示符时,它完美地工作。
我该如何得到这个工作?
谢谢!
'$ createFolder'应该是'$ unzip'吗? – prodigitalson
你忘记了在'ssh2_exec'函数中传递$ unzip。使用它。 –
对不起,我重新创建了代码,并且不小心忘了将$ createfolder更改为$ unzip文件夹。我编辑了我的问题。谢谢 –