php - 无法在 PHP 7.3.9 中启用 Curl

标签 php apache curl

当我尝试运行 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/

相关文章:

java - 将 Java Applet 上传到网页中

php - 如何解决 cURL Post 不发布数据的问题?

php - 如何在我的 paypal ipn 中使用 curl?

php - laravel 中 redis 的问题

php - 按 UserID 对结果进行分组,然后创建列数据数组

php - php is_callable() 函数中的 2 个参数的作用是什么?

php - PHP 文件中的 500 内部服务器错误

linux - svn: E000002: 无法打开请求的 SVN 文件系统

linux - Apache IP 地址有效,但 localhost 无效

windows - curl 包未在 ghci 加载