简体   繁体   中英

PHP Codeigniter curl_multi_init error

This is my code:

class facebookConnection {

            // Allow multi-threading.

            private $_mch = NULL;
            private $_properties = array();

            function __construct()
            {

                        $this->_mch = curl_multi_init();

                $this->_properties = array(
                    'code'      => CURLINFO_HTTP_CODE,
                    'time'      => CURLINFO_TOTAL_TIME,
                    'length'    => CURLINFO_CONTENT_LENGTH_DOWNLOAD,
                    'type'      => CURLINFO_CONTENT_TYPE
                );
            }

I get Fatal error: Call to undefined function curl_multi_init() in /var/www/application/libraries/facebook.php on line 123

This is running on my local machine... could that be a problem? I don't understand.

it sounds like that function is not installed in your PHP.

check phpinfo(); to see if it's enabled.

If you have WampServer installed .. left click on the icon of WampServer in system tray go to PHP > PHP Extensions > php_curl to enable curl

or open your php.ini file look for ;extension=php_curl.dll and remove ";" from beginning

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