2017-02-24 21:02
浏览 40


I have a wordpress plugin that is trying to use curl but giving me the following error.

PHP Fatal error: Uncaught Error: Call to undefined function curl_init()

$curl = curl_init();

I have the same issue on my local dev environment and in my staging environment. At the time of posting it will include the phpinfo() That will be removed if you see this at a later time. htaccess user/password is pixona:pixona to see the site.

I have tried many solutions offered with no luck. Open to ideas and can show other config settings as needed.

I have tried the following and restarted apache after each (on local machine):

apt-get install php-curl
apt-get install php7.0-curl

edited the php.ini to uncomment the following:


added this extension in the php.ini

phpenmod curl
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • doumao8803 2017-02-25 05:28

    The solution came down to the distribution being out of date. To diagnose the issue I made a sample script to see if curl was loading.

        if (!extension_loaded('curl')) {
            echo 'failed';
        } else {
            echo 'loaded';

    This gave me the following error:

    PHP Warning: PHP Startup: Unable to load dynamic library       '/usr/lib/php/20131226/' - /usr/lib/php/20131226/ undefined symbol: zend_unset_property in Unknown on line 0

    With that I came across this other question which suggested doing

    apt-get dist-upgrade

    PHP Startup: Unable to load dynamic library `` Ubuntu

    After the upgrade (I used the new php.ini) the script worked perfectly.

    打赏 评论

相关推荐 更多相似问题