使用SSH2 pecl扩展为Windows编译PHP的问题

时间:2011-07-08 16:24:03

标签: php windows ssh compilation php-extension

首先,我不是程序员。我是一名网络管理员,他被要求为启用了SSH2的网页设计师编译PHP。

我一直在跟着这个演练来编译适用于Windows的PHP: https://wiki.php.net/internals/windows/stepbystepbuild

要编译,我正在使用: Microsoft Visual C ++ Studio 2008 Express Microsoft Windows SDK 6.1

我已经下载了SSH2所需的所有强制性libraries和库。我已经提取并将它们放在'deps'文件夹中。我还下载了SSH2扩展代码并将其放在我在'x86'目录中创建的'pecl'文件夹中。

看起来编译器没有找到我添加的库。任何帮助将不胜感激!谢谢!

以下是尝试使用以下命令进行编译时遇到的一些错误:

C:\php-sdk\php53dev\vc9\x86\php5.3-201107071830>configure --enable-cli --with-ss
h2

Checking for library libjpeg_a.lib;libjpeg.lib ... <not found>
WARNING: gd not enabled; libraries and headers not found

Checking for zlib.h ...  <not found>
Checking for zlib.h ...  <not found>
WARNING: zip not enabled; libraries and headers not found


Checking for library libiconv_a.lib ... <not found>
Checking for library libiconv.lib ... <not found>
Checking for library iconv_a.lib ... <not found>
Checking for library iconv.lib ... <not found>
WARNING: iconv support can't be enabled, libraries or headers are missing

Checking for library zlib_a.lib;zlib.lib ... <not found>
WARNING: zlib support can't be enabled, zlib is missing


Checking for library libssh2_a.lib;libssh2.lib ... <not found>
WARNING: ssh2 not enabled: libraries or headers not found

Checking for library libxml2_a_dll.lib;libxml2_a.lib ... ..\deps\libxml2-2.7.3.w
in32\lib\libxml2_a_dll.lib
Checking for library libiconv_a.lib;iconv_a.lib;libiconv.lib;iconv.lib ... <not
found>

WARNING: libxml support can't be enabled, iconv or libxml are missing

WARNING: simplexml not enabled; libraries and headers not found

WARNING: xml support can't be enabled, libraries or headers are missing

WARNING: dom support can't be enabled, libxml is not enabled

3 个答案:

答案 0 :(得分:2)

对于SSH2: (更新的URL,我们把所有版本放在那里,在pecl / snaps下,也可以找到一些快照构建)。

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

对于构建中的错误,您缺少所有默认库。但如果你想要的只是ssh2,请使用:

configure --disable-all --enable-cli --with-ss2 = shared

(zts或nts也可能需要zts选项)

答案 1 :(得分:0)

皮埃尔正在进行一些构建,并在http://downloads.php.net/pierre/处可以使用它们,因为正在处理official place

如果您需要特定的东西,请在IRC上联系他:#php.pecl @ efnet。通常他愿意投入一些时间来帮助构建。

无论如何,ssh2有一些版本,只需在浏览器中按CTRL + F即可。

答案 2 :(得分:0)

您缺少依赖关系,即libssh2。您必须先编译它,然后将include包含在lib路径中,将lib文件放在lib路径中。对于PHP SDK,分别为deps/libdeps/include

然后再次运行configure