当我尝试运行 cUrl 时,我不断收到此错误:
Call to undefined function curl_init()
所以我尝试用以下几行安装它:
extension_dir = "C:\PHP7\ext"
extension=curl
但它从未出现在我的 phpinfo() 中;
以下来自 Apache 错误日志:
PHP Startup: Unable to load dynamic library 'curl' (tried: C:\\PHP7\\ext\\curl (The specified module could not be found.), C:\\PHP7\\ext\\php_curl.dll (The specified procedure could not be found.)) in Unknown on line 0
我还尝试了curl的绝对路径(扩展名=C:\PHP7\ext\php_curl.dll)
最佳答案
如果:
- 您的设置看起来正确。
- 您正在尝试为您的 PHP 安装加载正确的 DLL,而不是例如您在 Google 中随机找到的一些)。
- Curl 在命令行 PHP 中工作得很好。
但是当 PHP 作为 Apache 模块运行时你会得到这个:
PHP Startup: Unable to load dynamic library 'curl' (tried: C:\...\ext\curl (The specified module could not be found.), C:\...\ext\php_curl.dll (The specified procedure could not be found.)) in Unknown on line 0
如果您将 Apache 升级到最新版本,它就有可能得到修复。 (我也遇到过同样的问题 myself 。)
关于php - 无法在 PHP 7.3.9 中启用 Curl,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57871765/