Son*_*nic 9 64-bit curl apache2.4 windows-10 php-7
我使用的是Windows10 64位Apache 2.4.25(Win64)PHP 7.1.0-Win32-VC14-x64
当我尝试调用curl_init()函数时,我得到一个错误说"调用未定义的函数curl_init()"试过以下
任何帮助非常感谢.
bnp*_*887 21
以下是从获取PHP到启用cURL的步骤:
hoo*_*ogw 11
我通过以下方式修复:
1)编辑php.ini文件启用(取消注释)php_curl.dll和php_openssl.dll扩展
2)转到c:/ php7 /
将libssh2.dll复制到c:/ apache24/bin文件夹中.
3)测试:curl_test.php
<?php
// Script to test if the CURL extension is installed on this server
// Define function to test
function _is_curl_installed() {
if (in_array ('curl', get_loaded_extensions())) {
return true;
}
else {
return false;
}
}
// Ouput text to user based on test
if (_is_curl_installed()) {
echo "cURL is <span style=\"color:blue\">installed</span> on this server";
} else {
echo "cURL is NOT <span style=\"color:red\">installed</span> on this server";
}
?>
Run Code Online (Sandbox Code Playgroud)
小智 7
在PHP 7.2.2中Windows 10 Apache 2.4中搜索了一段时间后,为什么不加载cURL库,我只是将libssh2.dll从\ php复制到\ Apache24 \ bin,一切开始正常
我在使用 Acquia 的 Dev Desktop 时遇到了同样的问题,将 libcrypto-1_1-x64.dll 和 libssl-1_1-x64.dll 从 PHP7.3 文件夹复制到 Apache/bin 文件夹为我解决了这个问题。
“从版本 1.1.0 开始,OpenSSL 确实更改了它们的库名称!libeay32.dll 现在是 libcrypto- .dll(例如,64 位 Windows 上的 OpenSSL 1.1.x 的 libcrypto-1_1-x64.dll) ssleay32.dll 现在是 libssl- .dll (例如 64 位 Windows 上用于 OpenSSL 1.1.x 的 libssl-1_1-x64.dll)”
请参阅https://www.php.net/manual/en/curl.installation.php#121921。
归档时间: |
|
查看次数: |
17712 次 |
最近记录: |