热搜:NVER node 开发 php

windows系统下PHP安装和配置ssh2扩展?

2024-07-21 14:00:01
windows系统下PHP安装和配置ssh2扩展?

如题,我现在的项目需要使用到远程连接其他计算机操作指令。不知道如何安装和配置ssh2扩展,有高手能帮助我吗?


回复讨论(解决方案)

使用windows版本的 php_ssh2.dll

http://windows.php.net/downloads/pecl/releases/ssh2/0.12/

现在又有新问题了,我现在采取的措施是用PHP调用本地shell脚本,然后本地脚本中存放了调用远程机中脚本的代码。然后我用PHP调用这个本地脚本,结果本地脚本运行了,但是远程机上的脚本并没有运行。请问这是什么情况?  因为是用shell脚本进行远程,所以我没有在PHP上使用ssh2

你的脚本是怎么写的?

sudo /usr/bin/ssh -f root@10.4.62.241 /tmp/test.sh & echo "test.sh is starting"

echo "test" >> /tmp/a.txt & echo "ehlo"

你的脚本是怎么写的?




sudo /usr/bin/ssh -f root@10.4.62.241 /tmp/test.sh & echo "test.sh is starting"

echo "test" >> /tmp/a.txt & echo "ehlo"

这是 windows 下的命令吗?

这是 windows 下的命令吗?


不是的,现在抛弃windows了,直接用linux了,shell脚本里的

php5.6对应的ssh2版本有没有?直接用php5.5的会报错。