PHP在Windows机器上安装SSH2
我试图安装在的Windows + Apache的这种
机。
文件说,SSH2要求的OpenSSL
和 libssh2
库。
我在的php.ini
文件添加此行:
I am trying to install this on a Windows+Apache
machine.
Documentation says that SSH2 requires the OpenSSL
and libssh2
libraries.
I have added this lines in my php.ini
file:
extension=php_openssl.dll
extension=php_ssh2.dll
和重新启动Apache的,但它仍然没有工作(致命错误:调用未定义的函数ssh2_connect()
)。
and restarted Apache but it still not working (Fatal error: Call to undefined function ssh2_connect()
).
任何人都可以解释我如何安装此服务?
Can anyone explain me how to install this service?
感谢
PS:我是意大利人,对不起,我的英语...
ps: i'm italian, sorry for my english...
下面是我是如何做到的:
Here's how I did it:
-
这个位置
(选择合适的版本);
Downloaded Win32 SSH2 PECL extension from this location (choose the appropriate version);
提取档案的内容和:
- 放在
php_ssh2.dll
和php_ssh2.pdb
在转文件
文件夹(例如C:\\ PHP \\分机
); - 复制
libssh2.dll
文件复制到C:\\ Windows \\ System32下
键,(如果你有Win64上)C:\\ WINDOWS \\ Syswow64资料
文件夹(S);
- placed
php_ssh2.dll
andphp_ssh2.pdb
files in theext
folder (e.g.C:\php\ext
); - copied
libssh2.dll
file toC:\Windows\system32
and (if you got Win64)C:\Windows\SysWOW64
folder(s);
运行以下命令注册DLL:
Run the following command to register the DLL:
C:\> regsvr32 libssh2.dll
重启动Apache的。
Restarted Apache.
最后说明
如果你有PHP 64,你要查找的SSH2库/ DLL的x64版本。
本网站提供了一些Win64的编译库的PHP,第一次尝试在这里。
If you got PHP x64, you have to lookup for the x64 version of the SSH2 library / DLLs. This site offers some Win64 compiled libraries for PHP, try here first.
希望这有助于。