简体   繁体   中英

Call to undefined function curl_init() after updating PHP version in WAMP

I've been using WAMP for a long time without any problems with PHP 7.2.4. Today I've updated my PHP to 7.4.19 and it seems the cURL extension is not loading properly, I am getting the curl_init() error.

  • php.ini is configured correctly in php7.4.19 folder, extension=curl is uncommented, so is the php.ini file in apache/bin folder, which is basically just a link to the same file from the PHP directory
  • I've tried unchecking the cURL extension and turning it on again from WAMP settings and also directly in php.ini by commenting it, followed by restarting the WAMP or even Windows
  • in phpinfo() I can clearly see the cURL is not being loaded, if I switch back to 7.2.4 however and refresh the page, cURL loads just fine
  • I've tried copying the php_curl.dll from 7.2.4 /ext directory, to the current 7.4.19 /ext directory and rewriting the file
  • I've tried adding extension=php_curl.dll to php.ini as well

The system PATH is correctly configured. As I mentioned, it works well with older version of PHP, which uses the same system PATH.

System info:

  • WAMP 3.2.5 x64
  • Apache 2.4.33
  • PHP 7.4.19
  • MySQL and MariaDB probably not relevant at all
  • Windows 10 x64 with most recent updates

Basically I've tried everything I found online. Do you have any ideas?

This is very dumb of me, but I finally solved it, leaving this answer here in case anyone struggles with the same problem.

I needed to update Apache from 2.4.33 to 2.4.47 . Seems like the.33 version had problems with loading the cURL extension in PHP 7.4 for some reason.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM