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...
我是如何做到的:
-
从此位置下载Win32 SSH2 PECL扩展程序
(选择适当的版本);
Downloaded Win32 SSH2 PECL extension from this location (choose the appropriate version);
提取存档的内容:
- 在
中放置
文件夹(例如php_ssh2.dll
和php_ssh2.pdb
extC:\php\ext
); - 复制
利bssh2.dll
文件到C:\Windows\system32
和(如果你有Win64)C:\ Windows \SysWOW64
文件夹
- 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 x64,你必须查找对于x64版本的SSH2库/ DLL。
本网站为PHP提供了一些Win64编译库,请先尝试这里。
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.
希望这有帮助。