OpenSSL enabled but not working

后端 未结 1 753
余生分开走
余生分开走 2020-12-21 04:13

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

相关标签:
1条回答
  • 2020-12-21 05:05

    As the documentation states (quoting what you already quoted) :

    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.

    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.


    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...

    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 :

    • 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)
    0 讨论(0)
提交回复
热议问题