PHP unable to load php_curl.dll extension

后端 未结 13 2522
暖寄归人
暖寄归人 2020-11-29 08:58

Follow-up from my post yesterday (Enabling cURL with PHP)

The problem is that PHP isn\'t able to load php_curl.dll. I\'ve tried several steps including uncommenting

13条回答
  •  温柔的废话
    2020-11-29 09:25

    Usually this is an OpenSSL version mismatch error, between Apache and PHP. In case Apache loads PHP as a DSO module, its own OpenSSL versions (dlls and libs) will be used. So, in case the PHP extension requires a newer version, it may not find the appropriate interface inside the Apache-loaded DLLS and it will fail to work.

    Since you need the PHP extension to load, you need the relevant DLL files to be at least the version of what the PHP module asks for. Supposing that you 're using lastest builds for both Apache and PHP and both having been built with the same MVC version, you can copy the following files:

    • libcrypto-1_1.dll
    • libcrypto-1_1-x64.dll
    • libcurl.dll
    • libsasl.dll
    • libssh2.dll
    • libssl-1_1.dll
    • libssl-1_1-x64.dll
    • nghttp2.dll
    • libeay32.dll (if existing in your PHP distribution)
    • ssleay32.dll (if existing in your PHP distribution)

    from the PHP root folder to the Apache2/bin folder, in case you 're confident that the PHP build is newer than the Apache build.

    In the opposite case, you can copy the same files from the Apache BIN to the PHP root.

    In any case, backup the contents of the APache and PHP folders beforehand.

    Adding the PHP path as an enviromental variable will give priority to this path for loading the relevant DLLs and may solve the problem. However, you lose in server portability. Additionally, if you have also added the Apache PATH as a variable and the OpenSSL versions are way different (up to loading different linked DLL files), a lot of shit may happen.

提交回复
热议问题