OpenSSL的启用,但不工作 [英] OpenSSL enabled but not working

查看:427
本文介绍了OpenSSL的启用,但不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我运行的Apache 2.2.13和5.2.12 PHP。刚安装了PHP 5.2.12手动(有机会获得所有扩展)并启用OpenSSL的。 phpinfo()函数表示的OpenSSL已启用并运行的OpenSSL 0.9.8k 25 2009年3月

I am running Apache 2.2.13 and PHP 5.2.12. Just installed PHP 5.2.12 manually (to have access to all extensions) and enabled OpenSSL. phpinfo() indicates OpenSSL is enabled and running OpenSSL 0.9.8k 25 Mar 2009.

我得到这个错误:PHP的致命错误:调用未定义的函数ftp_ssl_connect()

I'm getting this error: PHP Fatal error: Call to undefined function ftp_ssl_connect().

我看到那里的PHP手册提出ftp_ssl_connect()仅如果FTP模块和OpenSSL的同时支持静态PHP内置,并进一步指出,必须自己编译PHP的二进制文件,使之与Windows工作。

I've seen where the PHP manual suggests 'ftp_ssl_connect() is only available if both the ftp module and the OpenSSL support is built statically into php' and further states that 'you must compile your own PHP binaries' to make it work with Windows.

我有怀疑的phpinfo()仅表示OpenSSL的为被'激活',因为我注释掉了线延长= php_openssl.dll'并在正确的文件夹正确的DLL和正确的路径中的环境变量。也许一个静态编译到PHP必须不管是什么的phpinfo()表示完成的。

I have the suspicion that phpinfo() only indicates OpenSSL as being 'enabled' because I have uncommented the line 'extension=php_openssl.dll' and have the correct dlls in the correct folders and the correct path in the environment variables. And perhaps a static build into PHP must be accomplished regardless of what phpinfo() indicates.

相信分布的目标(如上所述)可以动态扩展,但重新编译(OpenSSL的)是为en code进行静态扩展

I believe the objective of distribution (as described above) is for dynamic extensions, but recompiling (for OpenSSL) is to encode a static extension.

FTP扩展工作正常(内置到PHP 5.2)。我测试这与以下code:

ftp extension is working fine (built into PHP 5.2). I test this with the following code:

$ conn_id = FTP_CONNECT($网址);
$ login_result = ftp_login($ conn_id,$的用户名,密码$);
ftp_close($ conn_id);

$conn_id = ftp_connect($url); $login_result = ftp_login($conn_id, $username, $password); ftp_close($conn_id);

请注意,要检查SSL,我只能改变FTP_CONNECT到ftp_ssl_connect。当到达这条线,我得到上面我的Apache的错误日志文件中的PHP错误。

Note that to check ssl, I only change ftp_connect to ftp_ssl_connect. When reaching this line, I get the PHP error above in my Apache error log file.

推荐答案

由于文档状态(引用你已经报)的:

请注意:为什么这个功能可能不存在
  结果 ftp_ssl_connect()
  可用如果两个ftp的模块和
  OpenSSL的支持是建立
  静态到PHP,这意味着
  在Windows上这个功能将是
  未定义在官方PHP构建。
  结果若要使此功能
  在Windows上,您必须自己编译
  PHP的二进制文件。

Note: Why this function may not exist
ftp_ssl_connect() is only available if both the ftp module and the OpenSSL support is built statically into php, this means that on Windows this function will be undefined in the official PHP builds.
To make this function available on Windows you must compile your own PHP binaries.

您说您手动安装了PHP;但是这可能仍然意味着你使用的官,从php.net建设 - 这意味着你没有编译自己的PHP二进制文件......所以,该功能不可用

You say you installed PHP "manually" ; but this probably still means you used an "official" build from php.net -- which means you have not compiled your own PHP binaries... So, that function is not available.

结果
有没有神奇:看来你必须重新编译PHP,使用正确的配置选项在编译时,如果你希望能够使用该功能...


There is no magic : it seems you'll have to re-compile PHP, using the right configuration options at compile-time, if you want to be able to use that function...

下面是关于一些文档:建立在Windows 自己的PHP - 但。 ..好运气......我从来没有听说过,这是简单来编译PHP在Windows上,实际上的(它并不难在Linux,但Linux是也许有点更适合当谈到编译)

Here's some documentation about that : Build your own PHP on Windows -- but... good luck... i've never heard it was "simple" to compile PHP on windows, actually (it's not that hard on Linux, but Linux is maybe a bit more well suited when it comes to compilation)

结果
一对夫妇的其他解决方案:


A couple of other solutions :


  • 切换到Linux的发展的(即使它仅仅使用虚拟机)的 - 但你可能还是要重新编译PHP来获取的(可能被默认启用)

  • 只是不使用该功能;毕竟,你知道,如果你的托管服务会为你提供了吗?的(如果你不能用它在生产服务器上,不需要你的开发/测试机上使用)

  • switching to Linux for your developments (even if it's only using a Virtual Machine) -- but you might still have to recompile PHP to get that (might not be enabled by default)
  • just not using that function ; after all, do you know if your hosting service will provide you with it ? (If you can't use it on your production server, no need to use on your development/testing machine)

这篇关于OpenSSL的启用,但不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆