Call to undefined function curl_init() even it is enabled in php7

前端 未结 10 536
旧巷少年郎
旧巷少年郎 2020-12-03 01:00

I\'ve just installed php7 to my Ubuntu. At first, there was no problem, my web site was working. But suddenly, it started to return Call to undefined function curl_init() er

相关标签:
10条回答
  • 2020-12-03 01:23

    Your Filepath is probably incorrect

    Check the Apache error log in

    /var/log/apache2/error.log
    

    if the called path or filename does match your real path in e.g.

    /usr/lib/php/20151012/php_curl.so
    

    In my case it's been the same path, but "the php_" was missing

    /usr/lib/php/20151012/curl.so
    

    So I changed the path / filename accordingly in

    /etc/php/7.0/cli/conf.d/20-curl.ini 
    

    from

    extension=php_curl.so
    

    into

    extension=curl.so
    
    0 讨论(0)
  • 2020-12-03 01:32

    Your pages probably are not generated with the CLI SAPI. Check what phpinfo() returns when run from your webserver (its probably trying to read the wrong ini file).

    0 讨论(0)
  • 2020-12-03 01:32

    Scratched my head over this for a while, curl module was loaded but still got the error.
    This happen after I upgraded from Debian Stretch to Buster.

    The reason was that php7.3-curl was installed and used, but apache run php7.0 even though 7.3 was installed. So I removed php7.0 and reinstalled libapache2 to get it working

    apt-get remove php-7.0
    apt-get remove libapache2-mod-php7.3
    apt-get install libapache2-mod-php7.3
    
    0 讨论(0)
  • 2020-12-03 01:34
    • step 1 : Download Php 7,
    • step 2 : copy libeay32.dll and ssleay32.dll and past them in C:\Windows\System32.
    • step 3 : Replace the php_openssl.dll and php_curl.dll in C:\php\ext with the latest dll. restart apache

    This fixed my issues issue, hope someone benefits too

    0 讨论(0)
提交回复
热议问题